home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Source / WinTlb / WINGDI.IDL < prev    next >
Text File  |  1997-06-06  |  180KB  |  5,358 lines

  1. // wingdi.h -- GDI procedure declarations, constant definitions and macros *
  2.  
  3. #ifndef _WINGDI_
  4. #define _WINGDI_
  5.  
  6. typedef struct XFORM {
  7.     FLOAT   eM11;
  8.     FLOAT   eM12;
  9.     FLOAT   eM21;
  10.     FLOAT   eM22;
  11.     FLOAT   eDx;
  12.     FLOAT   eDy;
  13. } XFORM;
  14.  
  15. // Bitmap Header Definition 
  16. typedef struct BITMAP {
  17.     LONG        bmType;
  18.     LONG        bmWidth;
  19.     LONG        bmHeight;
  20.     LONG        bmWidthBytes;
  21.     WORD        bmPlanes;
  22.     WORD        bmBitsPixel;
  23.     LPVOID      bmBits;
  24. } BITMAP;
  25.  
  26. #pragma pack(push)
  27. #pragma pack(1)
  28. typedef struct RGBTRIPLE {
  29.         BYTE    rgbtBlue;
  30.         BYTE    rgbtGreen;
  31.         BYTE    rgbtRed;
  32. } RGBTRIPLE;
  33. #pragma pack(pop)
  34.  
  35. typedef struct RGBQUAD {
  36.         BYTE    rgbBlue;
  37.         BYTE    rgbGreen;
  38.         BYTE    rgbRed;
  39.         BYTE    rgbReserved;
  40. } RGBQUAD;
  41.  
  42. typedef LONG    LCSCSTYPE;
  43. typedef    LONG    LCSGAMUTMATCH;
  44.  
  45. typedef long            FXPT16DOT16; 
  46. typedef long            FXPT2DOT30;  
  47.  
  48. // ICM Color Definitions 
  49. // The following two structures are used for defining RGB's in terms of
  50. // CIEXYZ. The values are fixed point 16.16.
  51.  
  52. typedef struct CIEXYZ {
  53.     FXPT2DOT30 ciexyzX;
  54.     FXPT2DOT30 ciexyzY;
  55.     FXPT2DOT30 ciexyzZ;
  56. } CIEXYZ;
  57. typedef CIEXYZ  *LPCIEXYZ;
  58.  
  59. typedef struct ICEXYZTRIPLE {
  60.     CIEXYZ  ciexyzRed;
  61.     CIEXYZ  ciexyzGreen;
  62.     CIEXYZ  ciexyzBlue;
  63. } CIEXYZTRIPLE;
  64. typedef CIEXYZTRIPLE    *LPCIEXYZTRIPLE;
  65.  
  66. // The next structures the logical color space. Unlike pens and brushes,
  67. // but like palettes, there is only one way to create a LogColorSpace.
  68. // A pointer to it must be passed, its elements can't be pushed as
  69. // arguments.
  70.  
  71. typedef struct LOGCOLORSPACE {
  72.     DWORD lcsSignature;
  73.     DWORD lcsVersion;
  74.     DWORD lcsSize;
  75.     LCSCSTYPE lcsCSType;
  76.     LCSGAMUTMATCH lcsIntent;
  77.     CIEXYZTRIPLE lcsEndpoints;
  78.     DWORD lcsGammaRed;
  79.     DWORD lcsGammaGreen;
  80.     DWORD lcsGammaBlue;
  81. #ifdef UNICODE
  82.     BYTE lcsFilename[260 * 2]; // MAX_PATH
  83. #else
  84.     BYTE lcsFilename[260]; // MAX_PATH
  85. #endif
  86. } LOGCOLORSPACE;
  87.  
  88.  
  89. // structures for defining DIBs 
  90. typedef struct BITMAPCOREHEADER {
  91.         DWORD   bcSize;                 // used to get to color table 
  92.         WORD    bcWidth;
  93.         WORD    bcHeight;
  94.         WORD    bcPlanes;
  95.         WORD    bcBitCount;
  96. } BITMAPCOREHEADER, *LPBITMAPCOREHEADER, *PBITMAPCOREHEADER;
  97.  
  98.  
  99. typedef struct BITMAPINFOHEADER {
  100.         DWORD      biSize;
  101.         LONG       biWidth;
  102.         LONG       biHeight;
  103.         WORD       biPlanes;
  104.         WORD       biBitCount;
  105.         DWORD      biCompression;
  106.         DWORD      biSizeImage;
  107.         LONG       biXPelsPerMeter;
  108.         LONG       biYPelsPerMeter;
  109.         DWORD      biClrUsed;
  110.         DWORD      biClrImportant;
  111. } BITMAPINFOHEADER;
  112.  
  113.  
  114. typedef struct BITMAPV4HEADER {
  115.         DWORD        bV4Size;
  116.         LONG         bV4Width;
  117.         LONG         bV4Height;
  118.         WORD         bV4Planes;
  119.         WORD         bV4BitCount;
  120.         DWORD        bV4V4Compression;
  121.         DWORD        bV4SizeImage;
  122.         LONG         bV4XPelsPerMeter;
  123.         LONG         bV4YPelsPerMeter;
  124.         DWORD        bV4ClrUsed;
  125.         DWORD        bV4ClrImportant;
  126.         DWORD        bV4RedMask;
  127.         DWORD        bV4GreenMask;
  128.         DWORD        bV4BlueMask;
  129.         DWORD        bV4AlphaMask;
  130.         DWORD        bV4CSType;
  131.         CIEXYZTRIPLE bV4Endpoints;
  132.         DWORD        bV4GammaRed;
  133.         DWORD        bV4GammaGreen;
  134.         DWORD        bV4GammaBlue;
  135. } BITMAPV4HEADER;
  136.  
  137. typedef struct BITMAPINFO {
  138.     BITMAPINFOHEADER    bmiHeader;
  139.     RGBQUAD             bmiColors[1];
  140. } BITMAPINFO;
  141.  
  142. typedef struct BITMAPINFO256 {
  143.     BITMAPINFOHEADER    bmiHeader;
  144.     RGBQUAD             bmiColors[256];
  145. } BITMAPINFO256;
  146.  
  147. typedef struct BITMAPCOREINFO {
  148.     BITMAPCOREHEADER    bmciHeader;
  149.     RGBTRIPLE           bmciColors[1];
  150. } BITMAPCOREINFO;
  151.  
  152. typedef struct BITMAPCOREINFO256 {
  153.     BITMAPCOREHEADER    bmciHeader;
  154.     RGBTRIPLE           bmciColors[256];
  155. } BITMAPCOREINFO256;
  156.  
  157. #pragma pack(push)
  158. #pragma pack(2)
  159. typedef struct BITMAPFILEHEADER {
  160.         WORD    bfType;
  161.         DWORD   bfSize;
  162.         WORD    bfReserved1;
  163.         WORD    bfReserved2;
  164.         DWORD   bfOffBits;
  165. } BITMAPFILEHEADER;
  166. #pragma pack(pop)
  167.  
  168. // define MAKEPOINTS(l)       (*((POINTS *)&(l)))
  169.  
  170. typedef struct FONTSIGNATURE {
  171.     DWORD fsUsb[4];
  172.     DWORD fsCsb[2];
  173. } FONTSIGNATURE;
  174.  
  175. typedef struct CHARSETINFO {
  176.     UINT ciCharset;
  177.     UINT ciACP;
  178.     FONTSIGNATURE fs;
  179. } CHARSETINFO;
  180.  
  181. typedef struct LOCALESIGNATURE {
  182.     DWORD lsUsb[4];
  183.     DWORD lsCsbDefault[2];
  184.     DWORD lsCsbSupported[2];
  185. } LOCALESIGNATURE;
  186.  
  187. // Clipboard Metafile Picture Structure 
  188. typedef struct HANDLETABLE {
  189.     HGDIOBJ objectHandle[1];
  190. } HANDLETABLE;
  191.  
  192. typedef struct METARECORD {
  193.     DWORD       rdSize;
  194.     WORD        rdFunction;
  195.     WORD        rdParm[1];
  196. } METARECORD;
  197.  
  198. typedef struct METAFILEPICT {
  199.     LONG        mm;
  200.     LONG        xExt;
  201.     LONG        yExt;
  202.     HMETAFILE   hMF;
  203. } METAFILEPICT;
  204.  
  205. #include <pshpack2.h>
  206. typedef struct METAHEADER {
  207.     WORD        mtType;
  208.     WORD        mtHeaderSize;
  209.     WORD        mtVersion;
  210.     DWORD       mtSize;
  211.     WORD        mtNoObjects;
  212.     DWORD       mtMaxRecord;
  213.     WORD        mtNoParameters;
  214. } METAHEADER;
  215. #include <poppack.h>
  216.  
  217. // Enhanced Metafile structures 
  218. typedef struct ENHMETARECORD {
  219.     DWORD   iType;              // Record type EMR_XXX
  220.     DWORD   nSize;              // Record size in bytes
  221.     DWORD   dParm[1];           // Parameters
  222. } ENHMETARECORD;
  223.  
  224. typedef struct ENHMETAHEADER {
  225.     DWORD   iType;              // Record type EMR_HEADER
  226.     DWORD   nSize;              // Record size in bytes.  This may be greater
  227.                                 // than the sizeof(ENHMETAHEADER).
  228.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  229.     RECTL   rclFrame;           // Inclusive-inclusive Picture Frame of metafile in .01 mm units
  230.     DWORD   dSignature;         // Signature.  Must be ENHMETA_SIGNATURE.
  231.     DWORD   nVersion;           // Version number
  232.     DWORD   nBytes;             // Size of the metafile in bytes
  233.     DWORD   nRecords;           // Number of records in the metafile
  234.     WORD    nHandles;           // Number of handles in the handle table
  235.                                 // Handle index zero is reserved.
  236.     WORD    sReserved;          // Reserved.  Must be zero.
  237.     DWORD   nDescription;       // Number of chars in the unicode description string
  238.                                 // This is 0 if there is no description string
  239.     DWORD   offDescription;     // Offset to the metafile description record.
  240.                                 // This is 0 if there is no description string
  241.     DWORD   nPalEntries;        // Number of entries in the metafile palette.
  242.     SIZEL   szlDevice;          // Size of the reference device in pels
  243.     SIZEL   szlMillimeters;     // Size of the reference device in millimeters
  244. } ENHMETAHEADER;
  245.  
  246. // BCHAR definition for APPs
  247. #ifdef UNICODE
  248.     typedef WCHAR BCHAR;
  249. #else
  250.     typedef BYTE BCHAR;
  251. #endif
  252.  
  253.  
  254. typedef struct TEXTMETRIC {
  255.     LONG        tmHeight;
  256.     LONG        tmAscent;
  257.     LONG        tmDescent;
  258.     LONG        tmInternalLeading;
  259.     LONG        tmExternalLeading;
  260.     LONG        tmAveCharWidth;
  261.     LONG        tmMaxCharWidth;
  262.     LONG        tmWeight;
  263.     LONG        tmOverhang;
  264.     LONG        tmDigitizedAspectX;
  265.     LONG        tmDigitizedAspectY;
  266.     TCHAR       tmFirstChar;
  267.     TCHAR       tmLastChar;
  268.     TCHAR       tmDefaultChar;
  269.     TCHAR       tmBreakChar;
  270.     BYTE        tmItalic;
  271.     BYTE        tmUnderlined;
  272.     BYTE        tmStruckOut;
  273.     BYTE        tmPitchAndFamily;
  274.     BYTE        tmCharSet;
  275. } TEXTMETRIC;
  276.  
  277. #include <pshpack4.h>
  278. typedef struct NEWTEXTMETRIC {
  279.     LONG        tmHeight;
  280.     LONG        tmAscent;
  281.     LONG        tmDescent;
  282.     LONG        tmInternalLeading;
  283.     LONG        tmExternalLeading;
  284.     LONG        tmAveCharWidth;
  285.     LONG        tmMaxCharWidth;
  286.     LONG        tmWeight;
  287.     LONG        tmOverhang;
  288.     LONG        tmDigitizedAspectX;
  289.     LONG        tmDigitizedAspectY;
  290.     TCHAR       tmFirstChar;
  291.     TCHAR       tmLastChar;
  292.     TCHAR       tmDefaultChar;
  293.     TCHAR       tmBreakChar;
  294.     BYTE        tmItalic;
  295.     BYTE        tmUnderlined;
  296.     BYTE        tmStruckOut;
  297.     BYTE        tmPitchAndFamily;
  298.     BYTE        tmCharSet;
  299.     DWORD   ntmFlags;
  300.     UINT    ntmSizeEM;
  301.     UINT    ntmCellHeight;
  302.     UINT    ntmAvgWidth;
  303. } NEWTEXTMETRIC;
  304. #include <poppack.h>
  305.  
  306. typedef struct NEWTEXTMETRICEXA
  307. {
  308.     NEWTEXTMETRIC   ntmTm;
  309.     FONTSIGNATURE   ntmFontSig;
  310. }NEWTEXTMETRICEX;
  311.  
  312. // GDI Logical Objects:
  313.  
  314. // Pel Array 
  315. typedef struct PELARRAY {
  316.     LONG        paXCount;
  317.     LONG        paYCount;
  318.     LONG        paXExt;
  319.     LONG        paYExt;
  320.     BYTE        paRGBs;
  321.   } PELARRAY;
  322.  
  323. // Logical Brush (or Pattern) 
  324. typedef struct LOGBRUSH {
  325.     UINT        lbStyle;
  326.     COLORREF    lbColor;
  327.     LONG        lbHatch;
  328. } LOGBRUSH;
  329.  
  330. typedef LOGBRUSH            PATTERN;
  331.  
  332. // Logical Pen 
  333. typedef struct LOGPEN {
  334.     UINT        lopnStyle;
  335.     POINT       lopnWidth;
  336.     COLORREF    lopnColor;
  337. } LOGPEN;
  338.  
  339. typedef struct EXTLOGPEN {
  340.     DWORD       elpPenStyle;
  341.     DWORD       elpWidth;
  342.     UINT        elpBrushStyle;
  343.     COLORREF    elpColor;
  344.     LONG        elpHatch;
  345.     DWORD       elpNumEntries;
  346.     DWORD       elpStyleEntry[1];
  347. } EXTLOGPEN;
  348.  
  349. typedef struct LOGFONT
  350. {
  351.     LONG      lfHeight;
  352.     LONG      lfWidth;
  353.     LONG      lfEscapement;
  354.     LONG      lfOrientation;
  355.     LONG      lfWeight;
  356.     BYTE      lfItalic;
  357.     BYTE      lfUnderline;
  358.     BYTE      lfStrikeOut;
  359.     BYTE      lfCharSet;
  360.     BYTE      lfOutPrecision;
  361.     BYTE      lfClipPrecision;
  362.     BYTE      lfQuality;
  363.     BYTE      lfPitchAndFamily;
  364. #ifdef UNICODE
  365.     BYTE      lfFaceName[32 * 2];    // LF_FACESIZE
  366. #else
  367.     BYTE      lfFaceName[32];        // LF_FACESIZE
  368. #endif
  369.  
  370. } LOGFONT;
  371.  
  372. // Structure passed to FONTENUMPROC 
  373. typedef struct ENUMLOGFONT {
  374.     LOGFONT  elfLogFont;
  375. #ifdef UNICODE
  376.     BYTE     elfFullName[64 * 2];    // LF_FULLFACESIZE
  377.     BYTE     elfStyle[32 * 2];        // LF_FACESIZE
  378. #else
  379.     BYTE     elfFullName[64];        // LF_FULLFACESIZE
  380.     BYTE     elfStyle[32];            // LF_FACESIZE
  381. #endif
  382. } ENUMLOGFONT;
  383.  
  384. typedef struct ENUMLOGFONTEX {
  385.     LOGFONT    elfLogFont;
  386.     BYTE        elfFullName[64]; // LF_FULLFACESIZE
  387.     BYTE        elfStyle[32]; // LF_FACESIZE
  388.     BYTE        elfScript[32]; // LF_FACESIZE
  389. } ENUMLOGFONTEX;
  390.  
  391. typedef struct PANOSE {
  392.     BYTE    bFamilyType;
  393.     BYTE    bSerifStyle;
  394.     BYTE    bWeight;
  395.     BYTE    bProportion;
  396.     BYTE    bContrast;
  397.     BYTE    bStrokeVariation;
  398.     BYTE    bArmStyle;
  399.     BYTE    bLetterform;
  400.     BYTE    bMidline;
  401.     BYTE    bXHeight;
  402. } PANOSE;
  403.  
  404. // The extended logical font
  405. // An extension of the ENUMLOGFONT 
  406.  
  407. typedef struct EXTLOGFONT {
  408.     LOGFONT     elfLogFont;
  409. #ifdef UNICODE
  410.     BYTE        elfFullName[64 * 2];    // FULLFACESIZE
  411.     BYTE        elfStyle[64 * 2];        // FACESIZE
  412. #else
  413.     BYTE        elfFullName[64];        // FULLFACESIZE
  414.     BYTE        elfStyle[64];            // FACESIZE
  415. #endif
  416.     DWORD       elfVersion;     // 0 for the first release of NT 
  417.     DWORD       elfStyleSize;
  418.     DWORD       elfMatch;
  419.     DWORD       elfReserved;
  420.     BYTE        elfVendorId[4]; // ELF_VENDOR_SIZE     
  421.     DWORD       elfCulture;     // 0 for Latin                   
  422.     PANOSE      elfPanose;
  423. } EXTLOGFONT;
  424.  
  425. typedef struct DEVMODE {
  426. #ifdef UNICODE
  427.     BYTE dmDeviceName[32 * 2];    // CCHDEVICENAME
  428. #else
  429.     BYTE dmDeviceName[32];        // CCHDEVICENAME
  430. #endif
  431.     WORD dmSpecVersion;
  432.     WORD dmDriverVersion;
  433.     WORD dmSize;
  434.     WORD dmDriverExtra;
  435.     DWORD dmFields;
  436.     short dmOrientation;
  437.     short dmPaperSize;
  438.     short dmPaperLength;
  439.     short dmPaperWidth;
  440.     short dmScale;
  441.     short dmCopies;
  442.     short dmDefaultSource;
  443.     short dmPrintQuality;
  444.     short dmColor;
  445.     short dmDuplex;
  446.     short dmYResolution;
  447.     short dmTTOption;
  448.     short dmCollate;
  449. #ifdef UNICODE
  450.     BYTE  dmFormName[32 * 2];    // CCHFORMNAME
  451. #else
  452.     BYTE  dmFormName[32];        // CCHFORMNAME
  453. #endif
  454.     WORD   dmLogPixels;
  455.     DWORD  dmBitsPerPel;
  456.     DWORD  dmPelsWidth;
  457.     DWORD  dmPelsHeight;
  458.     DWORD  dmDisplayFlags;
  459.     DWORD  dmDisplayFrequency;
  460.     DWORD  dmICMMethod;
  461.     DWORD  dmICMIntent;
  462.     DWORD  dmMediaType;
  463.     DWORD  dmDitherType;
  464.     DWORD  dmReserved1;
  465.     DWORD  dmReserved2;
  466. } DEVMODE;
  467.  
  468. typedef struct RGNDATAHEADER {
  469.     DWORD   dwSize;
  470.     DWORD   iType;
  471.     DWORD   nCount;
  472.     DWORD   nRgnSize;
  473.     RECT    rcBound;
  474. } RGNDATAHEADER;
  475.  
  476. typedef struct RGNDATA {
  477.     RGNDATAHEADER   rdh;
  478.     char            Buffer[1];
  479. } RGNDATA;
  480.  
  481.  
  482. typedef struct ABC {
  483.     int     abcA;
  484.     UINT    abcB;
  485.     int     abcC;
  486. } ABC;
  487.  
  488. typedef struct ABCFLOAT {
  489.     FLOAT   abcfA;
  490.     FLOAT   abcfB;
  491.     FLOAT   abcfC;
  492. } ABCFLOAT;
  493.  
  494. typedef struct OUTLINETEXTMETRIC {
  495.     UINT    otmSize;
  496.     TEXTMETRIC otmTextMetrics;
  497.     BYTE    otmFiller;
  498.     PANOSE  otmPanoseNumber;
  499.     UINT    otmfsSelection;
  500.     UINT    otmfsType;
  501.      int    otmsCharSlopeRise;
  502.      int    otmsCharSlopeRun;
  503.      int    otmItalicAngle;
  504.     UINT    otmEMSquare;
  505.      int    otmAscent;
  506.      int    otmDescent;
  507.     UINT    otmLineGap;
  508.     UINT    otmsCapEmHeight;
  509.     UINT    otmsXHeight;
  510.     RECT    otmrcFontBox;
  511.      int    otmMacAscent;
  512.      int    otmMacDescent;
  513.     UINT    otmMacLineGap;
  514.     UINT    otmusMinimumPPEM;
  515.     POINT   otmptSubscriptSize;
  516.     POINT   otmptSubscriptOffset;
  517.     POINT   otmptSuperscriptSize;
  518.     POINT   otmptSuperscriptOffset;
  519.     UINT    otmsStrikeoutSize;
  520.      int    otmsStrikeoutPosition;
  521.      int    otmsUnderscoreSize;
  522.      int    otmsUnderscorePosition;
  523.     LPTSTR   otmpFamilyName;
  524.     LPTSTR   otmpFaceName;
  525.     LPTSTR   otmpStyleName;
  526.     LPTSTR   otmpFullName;
  527. } OUTLINETEXTMETRIC;
  528.  
  529. typedef struct POLYTEXT {
  530.     int       x;
  531.     int       y;
  532.     UINT      n;
  533.     LPCTSTR   LPTSTR;
  534.     UINT      uiFlags;
  535.     RECT      rcl;
  536.     int      *pdx;
  537. } POLYTEXTW;
  538.  
  539. typedef struct FIXED {
  540.     WORD    fract;
  541.     short   value;
  542. } FIXED;
  543.  
  544.  
  545. typedef struct MAT2 {
  546.      FIXED  eM11;
  547.      FIXED  eM12;
  548.      FIXED  eM21;
  549.      FIXED  eM22;
  550. } MAT2;
  551.  
  552.  
  553.  
  554. typedef struct GLYPHMETRICS {
  555.     UINT    gmBlackBoxX;
  556.     UINT    gmBlackBoxY;
  557.     POINT   gmptGlyphOrigin;
  558.     short   gmCellIncX;
  559.     short   gmCellIncY;
  560. } GLYPHMETRICS;
  561.  
  562. typedef struct POINTFX {
  563.     FIXED x;
  564.     FIXED y;
  565. } POINTFX, * LPPOINTFX;
  566.  
  567. typedef struct TTPOLYCURVE {
  568.     WORD    wType;
  569.     WORD    cpfx;
  570.     POINTFX apfx[1];
  571. } TTPOLYCURVE, * LPTTPOLYCURVE;
  572.  
  573. typedef struct TTPOLYGONHEADER {
  574.     DWORD   cb;
  575.     DWORD   dwType;
  576.     POINTFX pfxStart;
  577. } TTPOLYGONHEADER, * LPTTPOLYGONHEADER;
  578.  
  579.  
  580. typedef struct GCP_RESULTS {
  581.     DWORD   lStructSize;
  582.     LPTSTR    lpOutString;
  583.     UINT *lpOrder;
  584.     int  *lpDx;
  585.     int  *lpCaretPos;
  586.     LPTSTR    lpClass;
  587.     LPTSTR  lpGlyphs;
  588.     UINT    nGlyphs;
  589.     int     nMaxFit;
  590. } GCP_RESULTS;
  591.  
  592. typedef struct RASTERIZER_STATUS {
  593.     short   nSize;
  594.     short   wFlags;
  595.     short   nLanguageID;
  596. } RASTERIZER_STATUS;
  597.  
  598. // Pixel format descriptor 
  599. typedef struct PIXELFORMATDESCRIPTOR {
  600.     WORD  nSize;
  601.     WORD  nVersion;
  602.     DWORD dwFlags;
  603.     BYTE  iPixelType;
  604.     BYTE  cColorBits;
  605.     BYTE  cRedBits;
  606.     BYTE  cRedShift;
  607.     BYTE  cGreenBits;
  608.     BYTE  cGreenShift;
  609.     BYTE  cBlueBits;
  610.     BYTE  cBlueShift;
  611.     BYTE  cAlphaBits;
  612.     BYTE  cAlphaShift;
  613.     BYTE  cAccumBits;
  614.     BYTE  cAccumRedBits;
  615.     BYTE  cAccumGreenBits;
  616.     BYTE  cAccumBlueBits;
  617.     BYTE  cAccumAlphaBits;
  618.     BYTE  cDepthBits;
  619.     BYTE  cStencilBits;
  620.     BYTE  cAuxBuffers;
  621.     BYTE  iLayerType;
  622.     BYTE  bReserved;
  623.     DWORD dwLayerMask;
  624.     DWORD dwVisibleMask;
  625.     DWORD dwDamageMask;
  626. } PIXELFORMATDESCRIPTOR;
  627.  
  628. typedef CALLBACK OLDFONTENUMPROC;
  629. typedef CALLBACK GOBJENUMPROC;
  630. typedef CALLBACK LINEDDAPROC;
  631. typedef CALLBACK FONTENUMPROC;
  632.  
  633. typedef CALLBACK LPFNDEVMODE;
  634. typedef CALLBACK LPFNDEVCAPS;
  635.  
  636. typedef CALLBACK MFENUMPROC;
  637. typedef CALLBACK ENHMFENUMPROC;
  638.  
  639. typedef struct DIBSECTION {
  640.     BITMAP              dsBm;
  641.     BITMAPINFOHEADER    dsBmih;
  642.     DWORD               dsBitfields[3];
  643.     HANDLE              dshSection;
  644.     DWORD               dsOffset;
  645. } DIBSECTION;
  646.  
  647. typedef struct  COLORADJUSTMENT {
  648.     WORD   caSize;
  649.     WORD   caFlags;
  650.     WORD   caIlluminantIndex;
  651.     WORD   caRedGamma;
  652.     WORD   caGreenGamma;
  653.     WORD   caBlueGamma;
  654.     WORD   caReferenceBlack;
  655.     WORD   caReferenceWhite;
  656.     SHORT  caContrast;
  657.     SHORT  caBrightness;
  658.     SHORT  caColorfulness;
  659.     SHORT  caRedGreenTint;
  660. } COLORADJUSTMENT;
  661.  
  662. typedef CALLBACK ABORTPROC;
  663.  
  664. typedef struct DOCINFO {
  665.     int     cbSize;
  666.     LPCTSTR  lpszDocName;
  667.     LPCTSTR  lpszOutput;
  668.     LPCTSTR  lpszDatatype;
  669.     DWORD    fwType;
  670. } DOCINFO;
  671.  
  672. typedef struct KERNINGPAIR {
  673.    WORD wFirst;
  674.    WORD wSecond;
  675.    int  iKernAmount;
  676. } KERNINGPAIR;
  677.  
  678. typedef CALLBACK ICMENUMPROC;
  679.  
  680. // Base record type for the enhanced metafile.
  681.  
  682. typedef struct EMR {
  683.     DWORD   iType;              // Enhanced metafile record type
  684.     DWORD   nSize;              // Length of the record in bytes.
  685.                                 // This must be a multiple of 4.
  686. } EMR;
  687.  
  688. // Base text record type for the enhanced metafile.
  689.  
  690. typedef struct EMRTEXT {
  691.     POINTL  ptlReference;
  692.     DWORD   nChars;
  693.     DWORD   offString;          // Offset to the string
  694.     DWORD   fOptions;
  695.     RECTL   rcl;
  696.     DWORD   offDx;              // Offset to the inter-character spacing array.
  697.                                 // This is always given.
  698. } EMRTEXT;
  699.  
  700. // Record structures for the enhanced metafile.
  701.  
  702. typedef struct ABORTPATH {
  703.     EMR     emr;
  704. } ABORTPATH;
  705. typedef ABORTPATH EMRABORTPATH;
  706. typedef ABORTPATH EMRBEGINPATH;
  707. typedef ABORTPATH EMRENDPATH;
  708. typedef ABORTPATH EMRCLOSEFIGURE;
  709. typedef ABORTPATH EMRFLATTENPATH;
  710. typedef ABORTPATH EMRWIDENPATH;
  711. typedef ABORTPATH EMRSETMETARGN;
  712. typedef ABORTPATH EMRSAVEDC;
  713. typedef ABORTPATH EMRREALIZEPALETTE;
  714.  
  715. typedef struct EMRSELECTCLIPPATH {
  716.     EMR     emr;
  717.     DWORD   iMode;
  718. } EMRSELECTCLIPPATH;
  719. typedef EMRSELECTCLIPPATH  EMRSETBKMODE;
  720. typedef EMRSELECTCLIPPATH  EMRSETMAPMODE;
  721. typedef EMRSELECTCLIPPATH  EMRSETPOLYFILLMODE;
  722. typedef EMRSELECTCLIPPATH  EMRSETROP2;
  723. typedef EMRSELECTCLIPPATH  EMRSETSTRETCHBLTMODE;
  724. typedef EMRSELECTCLIPPATH  EMRSETICMMODE;
  725. typedef EMRSELECTCLIPPATH  EMRSETTEXTALIGN;
  726.  
  727. typedef struct EMRSETMITERLIMIT {
  728.     EMR     emr;
  729.     FLOAT   eMiterLimit;
  730. } EMRSETMITERLIMIT;
  731.  
  732. typedef struct EMRRESTOREDC {
  733.     EMR     emr;
  734.     LONG    iRelative;          // Specifies a relative instance
  735. } EMRRESTOREDC;
  736.  
  737. typedef struct EMRSETARCDIRECTION {
  738.     EMR     emr;
  739.     DWORD   iArcDirection;      // Specifies the arc direction in the
  740.                                 // advanced graphics mode.
  741. } EMRSETARCDIRECTION;
  742.  
  743. typedef struct EMRSETMAPPERFLAGS {
  744.     EMR     emr;
  745.     DWORD   dwFlags;
  746. } EMRSETMAPPERFLAGS;
  747.  
  748. typedef struct EMRSETTEXTCOLOR {
  749.     EMR     emr;
  750.     COLORREF crColor;
  751. } EMRSETBKCOLOR;
  752. typedef EMRSETBKCOLOR EMRSETTEXTCOLOR;
  753.  
  754. typedef struct EMRSELECTOBJECT {
  755.     EMR     emr;
  756.     DWORD   ihObject;           // Object handle index
  757. } EMRSELECTOBJECT;
  758. // TYPEDEF EMRSELECTOBJECT EMRDELETEOBJECT;
  759.  
  760. typedef struct EMRSELECTCOLORSPACE {
  761.     EMR     emr;
  762.     DWORD   ihCS;               // ColorSpace handle index
  763. } EMRSELECTCOLORSPACE;
  764. typedef EMRSELECTCOLORSPACE EMRDELETECOLORSPACE;
  765.  
  766. typedef struct EMRSELECTPALETTE {
  767.     EMR     emr;
  768.     DWORD   ihPal;              // Palette handle index, background mode only
  769. } EMRSELECTPALETTE;
  770.  
  771. typedef struct EMRRESIZEPALETTE {
  772.     EMR     emr;
  773.     DWORD   ihPal;              // Palette handle index
  774.     DWORD   cEntries;
  775. } EMRRESIZEPALETTE;
  776.  
  777. typedef struct EMRSETPALETTEENTRIES {
  778.     EMR     emr;
  779.     DWORD   ihPal;              // Palette handle index
  780.     DWORD   iStart;
  781.     DWORD   cEntries;
  782.     PALETTEENTRY aPalEntries[1];// The peFlags fields do not contain any flags
  783. } EMRSETPALETTEENTRIES;
  784.  
  785. typedef struct EMRSETCOLORADJUSTMENT {
  786.     EMR     emr;
  787.     COLORADJUSTMENT ColorAdjustment;
  788. } EMRSETCOLORADJUSTMENT;
  789.  
  790. typedef struct EMRGDICOMMENT {
  791.     EMR     emr;
  792.     DWORD   cbData;             // Size of data in bytes
  793.     BYTE    Data[1];
  794. } EMRGDICOMMENT, *PEMRGDICOMMENT;
  795.  
  796. typedef struct EMREOF {
  797.     EMR     emr;
  798.     DWORD   nPalEntries;        // Number of palette entries
  799.     DWORD   offPalEntries;      // Offset to the palette entries
  800.     DWORD   nSizeLast;          // Same as nSize and must be the last DWORD
  801.                                 // of the record.  The palette entries,
  802.                                 // if exist, precede this field.
  803. } EMREOF, *PEMREOF;
  804.  
  805. typedef struct EMRLINETO {
  806.     EMR     emr;
  807.     POINTL  ptl;
  808. } EMRLINETO,   *PEMRLINETO,
  809.   EMRMOVETOEX, *PEMRMOVETOEX;
  810.  
  811. typedef struct EMROFFSETCLIPRGN {
  812.     EMR     emr;
  813.     POINTL  ptlOffset;
  814. } EMROFFSETCLIPRGN, *PEMROFFSETCLIPRGN;
  815.  
  816. typedef struct EMRFILLPATH {
  817.     EMR     emr;
  818.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  819. } EMRFILLPATH,          *PEMRFILLPATH,
  820.   EMRSTROKEANDFILLPATH, *PEMRSTROKEANDFILLPATH,
  821.   EMRSTROKEPATH,        *PEMRSTROKEPATH;
  822.  
  823. typedef struct EMREXCLUDECLIPRECT {
  824.     EMR     emr;
  825.     RECTL   rclClip;
  826. } EMREXCLUDECLIPRECT,   *PEMREXCLUDECLIPRECT,
  827.   EMRINTERSECTCLIPRECT, *PEMRINTERSECTCLIPRECT;
  828.  
  829. typedef struct EMRSETVIEWPORTORGEX {
  830.     EMR     emr;
  831.     POINTL  ptlOrigin;
  832. } EMRSETVIEWPORTORGEX, *PEMRSETVIEWPORTORGEX,
  833.   EMRSETWINDOWORGEX,   *PEMRSETWINDOWORGEX,
  834.   EMRSETBRUSHORGEX,    *PEMRSETBRUSHORGEX;
  835.  
  836. typedef struct EMRSETVIEWPORTEXTEX {
  837.     EMR     emr;
  838.     SIZEL   szlExtent;
  839. } EMRSETVIEWPORTEXTEX, *PEMRSETVIEWPORTEXTEX,
  840.   EMRSETWINDOWEXTEX,   *PEMRSETWINDOWEXTEX;
  841.  
  842. typedef struct EMRSCALEVIEWPORTEXTEX {
  843.     EMR     emr;
  844.     LONG    xNum;
  845.     LONG    xDenom;
  846.     LONG    yNum;
  847.     LONG    yDenom;
  848. } EMRSCALEVIEWPORTEXTEX, *PEMRSCALEVIEWPORTEXTEX,
  849.   EMRSCALEWINDOWEXTEX,   *PEMRSCALEWINDOWEXTEX;
  850.  
  851. typedef struct EMRSETWORLDTRANSFORM {
  852.     EMR     emr;
  853.     XFORM   xform;
  854. } EMRSETWORLDTRANSFORM, *PEMRSETWORLDTRANSFORM;
  855.  
  856. typedef struct EMRMODIFYWORLDTRANSFORM {
  857.     EMR     emr;
  858.     XFORM   xform;
  859.     DWORD   iMode;
  860. } EMRMODIFYWORLDTRANSFORM, *PEMRMODIFYWORLDTRANSFORM;
  861.  
  862. typedef struct EMRSETPIXELV {
  863.     EMR     emr;
  864.     POINTL  ptlPixel;
  865.     COLORREF crColor;
  866. } EMRSETPIXELV, *PEMRSETPIXELV;
  867.  
  868. typedef struct EMREXTFLOODFILL {
  869.     EMR     emr;
  870.     POINTL  ptlStart;
  871.     COLORREF crColor;
  872.     DWORD   iMode;
  873. } EMREXTFLOODFILL, *PEMREXTFLOODFILL;
  874.  
  875. typedef struct EMRELLIPSE {
  876.     EMR     emr;
  877.     RECTL   rclBox;             // Inclusive-inclusive bounding rectangle
  878. } EMRELLIPSE,  *PEMRELLIPSE,
  879.   EMRRECTANGLE, *PEMRRECTANGLE;
  880.  
  881. typedef struct EMRROUNDRECT {
  882.     EMR     emr;
  883.     RECTL   rclBox;             // Inclusive-inclusive bounding rectangle
  884.     SIZEL   szlCorner;
  885. } EMRROUNDRECT, *PEMRROUNDRECT;
  886.  
  887. typedef struct EMRARC {
  888.     EMR     emr;
  889.     RECTL   rclBox;             // Inclusive-inclusive bounding rectangle
  890.     POINTL  ptlStart;
  891.     POINTL  ptlEnd;
  892. } EMRARC,   *PEMRARC,
  893.   EMRARCTO, *PEMRARCTO,
  894.   EMRCHORD, *PEMRCHORD,
  895.   EMRPIE,   *PEMRPIE;
  896.  
  897. typedef struct EMRANGLEARC {
  898.     EMR     emr;
  899.     POINTL  ptlCenter;
  900.     DWORD   nRadius;
  901.     FLOAT   eStartAngle;
  902.     FLOAT   eSweepAngle;
  903. } EMRANGLEARC, *PEMRANGLEARC;
  904.  
  905. typedef struct EMRPOLYLINE {
  906.     EMR     emr;
  907.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  908.     DWORD   cptl;
  909.     POINTL  aptl[1];
  910. } EMRPOLYLINE,     *PEMRPOLYLINE,
  911.   EMRPOLYBEZIER,   *PEMRPOLYBEZIER,
  912.   EMRPOLYGON,      *PEMRPOLYGON,
  913.   EMRPOLYBEZIERTO, *PEMRPOLYBEZIERTO,
  914.   EMRPOLYLINETO,   *PEMRPOLYLINETO;
  915.  
  916. typedef struct EMRPOLYLINE16 {
  917.     EMR     emr;
  918.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  919.     DWORD   cpts;
  920.     POINTS  apts[1];
  921. } EMRPOLYLINE16,     *PEMRPOLYLINE16,
  922.   EMRPOLYBEZIER16,   *PEMRPOLYBEZIER16,
  923.   EMRPOLYGON16,      *PEMRPOLYGON16,
  924.   EMRPOLYBEZIERTO16, *PEMRPOLYBEZIERTO16,
  925.   EMRPOLYLINETO16,   *PEMRPOLYLINETO16;
  926.  
  927. typedef struct EMRPOLYDRAW {
  928.     EMR     emr;
  929.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  930.     DWORD   cptl;               // Number of points
  931.     POINTL  aptl[1];            // Array of points
  932.     BYTE    abTypes[1];         // Array of point types
  933. } EMRPOLYDRAW, *PEMRPOLYDRAW;
  934.  
  935. typedef struct EMRPOLYDRAW16 {
  936.     EMR     emr;
  937.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  938.     DWORD   cpts;               // Number of points
  939.     POINTS  apts[1];            // Array of points
  940.     BYTE    abTypes[1];         // Array of point types
  941. } EMRPOLYDRAW16, *PEMRPOLYDRAW16;
  942.  
  943. typedef struct EMRPOLYPOLYLINE {
  944.     EMR     emr;
  945.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  946.     DWORD   nPolys;             // Number of polys
  947.     DWORD   cptl;               // Total number of points in all polys
  948.     DWORD   aPolyCounts[1];     // Array of point counts for each poly
  949.     POINTL  aptl[1];            // Array of points
  950. } EMRPOLYPOLYLINE, *PEMRPOLYPOLYLINE,
  951.   EMRPOLYPOLYGON,  *PEMRPOLYPOLYGON;
  952.  
  953. typedef struct EMRPOLYPOLYLINE16 {
  954.     EMR     emr;
  955.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  956.     DWORD   nPolys;             // Number of polys
  957.     DWORD   cpts;               // Total number of points in all polys
  958.     DWORD   aPolyCounts[1];     // Array of point counts for each poly
  959.     POINTS  apts[1];            // Array of points
  960. } EMRPOLYPOLYLINE16, *PEMRPOLYPOLYLINE16,
  961.   EMRPOLYPOLYGON16,  *PEMRPOLYPOLYGON16;
  962.  
  963. typedef struct EMRINVERTRGN {
  964.     EMR     emr;
  965.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  966.     DWORD   cbRgnData;          // Size of region data in bytes
  967.     BYTE    RgnData[1];
  968. } EMRINVERTRGN, *PEMRINVERTRGN,
  969.   EMRPAINTRGN,  *PEMRPAINTRGN;
  970.  
  971. typedef struct EMRFILLRGN {
  972.     EMR     emr;
  973.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  974.     DWORD   cbRgnData;          // Size of region data in bytes
  975.     DWORD   ihBrush;            // Brush handle index
  976.     BYTE    RgnData[1];
  977. } EMRFILLRGN, *PEMRFILLRGN;
  978.  
  979. typedef struct EMRFRAMERGN {
  980.     EMR     emr;
  981.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  982.     DWORD   cbRgnData;          // Size of region data in bytes
  983.     DWORD   ihBrush;            // Brush handle index
  984.     SIZEL   szlStroke;
  985.     BYTE    RgnData[1];
  986. } EMRFRAMERGN, *PEMRFRAMERGN;
  987.  
  988. typedef struct EMREXTSELECTCLIPRGN {
  989.     EMR     emr;
  990.     DWORD   cbRgnData;          // Size of region data in bytes
  991.     DWORD   iMode;
  992.     BYTE    RgnData[1];
  993. } EMREXTSELECTCLIPRGN, *PEMREXTSELECTCLIPRGN;
  994.  
  995. typedef struct EMREXTTEXTOUTA {
  996.     EMR     emr;
  997.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  998.     DWORD   iGraphicsMode;      // Current graphics mode
  999.     FLOAT   exScale;            // X and Y scales from Page units to .01mm units
  1000.     FLOAT   eyScale;            //   if graphics mode is GM_COMPATIBLE.
  1001.     EMRTEXT emrtext;            // This is followed by the string and spacing
  1002.                                 // array
  1003. } EMREXTTEXTOUTA, *PEMREXTTEXTOUTA,
  1004.   EMREXTTEXTOUTW, *PEMREXTTEXTOUTW;
  1005.  
  1006. typedef struct EMRPOLYTEXTOUT {
  1007.     EMR     emr;
  1008.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  1009.     DWORD   iGraphicsMode;      // Current graphics mode
  1010.     FLOAT   exScale;            // X and Y scales from Page units to .01mm units
  1011.     FLOAT   eyScale;            //   if graphics mode is GM_COMPATIBLE.
  1012.     LONG    cStrings;
  1013.     EMRTEXT aemrtext[1];        // Array of EMRTEXT structures.  This is
  1014.                                 // followed by the strings and spacing arrays.
  1015. } EMRPOLYTEXTOUTA, *PEMRPOLYTEXTOUTA,
  1016.   EMRPOLYTEXTOUTW, *PEMRPOLYTEXTOUTW;
  1017.  
  1018. typedef struct EMRBITBLT {
  1019.     EMR     emr;
  1020.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  1021.     LONG    xDest;
  1022.     LONG    yDest;
  1023.     LONG    cxDest;
  1024.     LONG    cyDest;
  1025.     DWORD   dwRop;
  1026.     LONG    xSrc;
  1027.     LONG    ySrc;
  1028.     XFORM   xformSrc;           // Source DC transform
  1029.     COLORREF crBkColorSrc;      // Source DC BkColor in RGB
  1030.     DWORD   iUsageSrc;          // Source bitmap info color table usage
  1031.                                 // (DIB_RGB_COLORS)
  1032.     DWORD   offBmiSrc;          // Offset to the source BITMAPINFO structure
  1033.     DWORD   cbBmiSrc;           // Size of the source BITMAPINFO structure
  1034.     DWORD   offBitsSrc;         // Offset to the source bitmap bits
  1035.     DWORD   cbBitsSrc;          // Size of the source bitmap bits
  1036. } EMRBITBLT, *PEMRBITBLT;
  1037.  
  1038. typedef struct EMRSTRETCHBLT {
  1039.     EMR     emr;
  1040.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  1041.     LONG    xDest;
  1042.     LONG    yDest;
  1043.     LONG    cxDest;
  1044.     LONG    cyDest;
  1045.     DWORD   dwRop;
  1046.     LONG    xSrc;
  1047.     LONG    ySrc;
  1048.     XFORM   xformSrc;           // Source DC transform
  1049.     COLORREF crBkColorSrc;      // Source DC BkColor in RGB
  1050.     DWORD   iUsageSrc;          // Source bitmap info color table usage
  1051.                                 // (DIB_RGB_COLORS)
  1052.     DWORD   offBmiSrc;          // Offset to the source BITMAPINFO structure
  1053.     DWORD   cbBmiSrc;           // Size of the source BITMAPINFO structure
  1054.     DWORD   offBitsSrc;         // Offset to the source bitmap bits
  1055.     DWORD   cbBitsSrc;          // Size of the source bitmap bits
  1056.     LONG    cxSrc;
  1057.     LONG    cySrc;
  1058. } EMRSTRETCHBLT, *PEMRSTRETCHBLT;
  1059.  
  1060. typedef struct EMRMASKBLT {
  1061.     EMR     emr;
  1062.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  1063.     LONG    xDest;
  1064.     LONG    yDest;
  1065.     LONG    cxDest;
  1066.     LONG    cyDest;
  1067.     DWORD   dwRop;
  1068.     LONG    xSrc;
  1069.     LONG    ySrc;
  1070.     XFORM   xformSrc;           // Source DC transform
  1071.     COLORREF crBkColorSrc;      // Source DC BkColor in RGB
  1072.     DWORD   iUsageSrc;          // Source bitmap info color table usage
  1073.                                 // (DIB_RGB_COLORS)
  1074.     DWORD   offBmiSrc;          // Offset to the source BITMAPINFO structure
  1075.     DWORD   cbBmiSrc;           // Size of the source BITMAPINFO structure
  1076.     DWORD   offBitsSrc;         // Offset to the source bitmap bits
  1077.     DWORD   cbBitsSrc;          // Size of the source bitmap bits
  1078.     LONG    xMask;
  1079.     LONG    yMask;
  1080.     DWORD   iUsageMask;         // Mask bitmap info color table usage
  1081.     DWORD   offBmiMask;         // Offset to the mask BITMAPINFO structure if any
  1082.     DWORD   cbBmiMask;          // Size of the mask BITMAPINFO structure if any
  1083.     DWORD   offBitsMask;        // Offset to the mask bitmap bits if any
  1084.     DWORD   cbBitsMask;         // Size of the mask bitmap bits if any
  1085. } EMRMASKBLT, *PEMRMASKBLT;
  1086.  
  1087. typedef struct EMRPLGBLT {
  1088.     EMR     emr;
  1089.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  1090.     POINTL  aptlDest[3];
  1091.     LONG    xSrc;
  1092.     LONG    ySrc;
  1093.     LONG    cxSrc;
  1094.     LONG    cySrc;
  1095.     XFORM   xformSrc;           // Source DC transform
  1096.     COLORREF crBkColorSrc;      // Source DC BkColor in RGB
  1097.     DWORD   iUsageSrc;          // Source bitmap info color table usage
  1098.                                 // (DIB_RGB_COLORS)
  1099.     DWORD   offBmiSrc;          // Offset to the source BITMAPINFO structure
  1100.     DWORD   cbBmiSrc;           // Size of the source BITMAPINFO structure
  1101.     DWORD   offBitsSrc;         // Offset to the source bitmap bits
  1102.     DWORD   cbBitsSrc;          // Size of the source bitmap bits
  1103.     LONG    xMask;
  1104.     LONG    yMask;
  1105.     DWORD   iUsageMask;         // Mask bitmap info color table usage
  1106.     DWORD   offBmiMask;         // Offset to the mask BITMAPINFO structure if any
  1107.     DWORD   cbBmiMask;          // Size of the mask BITMAPINFO structure if any
  1108.     DWORD   offBitsMask;        // Offset to the mask bitmap bits if any
  1109.     DWORD   cbBitsMask;         // Size of the mask bitmap bits if any
  1110. } EMRPLGBLT, *PEMRPLGBLT;
  1111.  
  1112. typedef struct EMRSETDIBITSTODEVICE {
  1113.     EMR     emr;
  1114.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  1115.     LONG    xDest;
  1116.     LONG    yDest;
  1117.     LONG    xSrc;
  1118.     LONG    ySrc;
  1119.     LONG    cxSrc;
  1120.     LONG    cySrc;
  1121.     DWORD   offBmiSrc;          // Offset to the source BITMAPINFO structure
  1122.     DWORD   cbBmiSrc;           // Size of the source BITMAPINFO structure
  1123.     DWORD   offBitsSrc;         // Offset to the source bitmap bits
  1124.     DWORD   cbBitsSrc;          // Size of the source bitmap bits
  1125.     DWORD   iUsageSrc;          // Source bitmap info color table usage
  1126.     DWORD   iStartScan;
  1127.     DWORD   cScans;
  1128. } EMRSETDIBITSTODEVICE, *PEMRSETDIBITSTODEVICE;
  1129.  
  1130. typedef struct EMRSTRETCHDIBITS {
  1131.     EMR     emr;
  1132.     RECTL   rclBounds;          // Inclusive-inclusive bounds in device units
  1133.     LONG    xDest;
  1134.     LONG    yDest;
  1135.     LONG    xSrc;
  1136.     LONG    ySrc;
  1137.     LONG    cxSrc;
  1138.     LONG    cySrc;
  1139.     DWORD   offBmiSrc;          // Offset to the source BITMAPINFO structure
  1140.     DWORD   cbBmiSrc;           // Size of the source BITMAPINFO structure
  1141.     DWORD   offBitsSrc;         // Offset to the source bitmap bits
  1142.     DWORD   cbBitsSrc;          // Size of the source bitmap bits
  1143.     DWORD   iUsageSrc;          // Source bitmap info color table usage
  1144.     DWORD   dwRop;
  1145.     LONG    cxDest;
  1146.     LONG    cyDest;
  1147. } EMRSTRETCHDIBITS, *PEMRSTRETCHDIBITS;
  1148.  
  1149. typedef struct EMREXTCREATEFONTINDIRECT {
  1150.     EMR     emr;
  1151.     DWORD   ihFont;             // Font handle index
  1152.     EXTLOGFONT elfw;
  1153. } EMREXTCREATEFONTINDIRECT, *PEMREXTCREATEFONTINDIRECT;
  1154.  
  1155. typedef struct EMRCREATEPALETTE {
  1156.     EMR     emr;
  1157.     DWORD   ihPal;              // Palette handle index
  1158.     LOGPALETTE lgpl;            // The peFlags fields in the palette entries
  1159.                                 // do not contain any flags
  1160. } EMRCREATEPALETTE, *PEMRCREATEPALETTE;
  1161.  
  1162. typedef struct EMRCREATEPALETTE256 {
  1163.     EMR     emr;
  1164.     DWORD   ihPal;              // Palette handle index
  1165.     LOGPALETTE256 lgpl;            // The peFlags fields in the palette entries
  1166.                                 // do not contain any flags
  1167. } EMRCREATEPALETTE256, *PEMRCREATEPALETTE256;
  1168.  
  1169. typedef struct EMRCREATECOLORSPACE {
  1170.     EMR         emr;
  1171.     DWORD       ihCS;   // ColorSpace handle index
  1172.     LOGCOLORSPACE  lcs;
  1173. } EMRCREATECOLORSPACE, *PEMRCREATECOLORSPACE;
  1174.  
  1175. typedef struct EMRCREATEPEN {
  1176.     EMR     emr;
  1177.     DWORD   ihPen;              // Pen handle index
  1178.     LOGPEN  lopn;
  1179. } EMRCREATEPEN, *PEMRCREATEPEN;
  1180.  
  1181. typedef struct EMREXTCREATEPEN {
  1182.     EMR     emr;
  1183.     DWORD   ihPen;              // Pen handle index
  1184.     DWORD   offBmi;             // Offset to the BITMAPINFO structure if any
  1185.     DWORD   cbBmi;              // Size of the BITMAPINFO structure if any
  1186.                                 // The bitmap info is followed by the bitmap
  1187.                                 // bits to form a packed DIB.
  1188.     DWORD   offBits;            // Offset to the brush bitmap bits if any
  1189.     DWORD   cbBits;             // Size of the brush bitmap bits if any
  1190.     EXTLOGPEN elp;              // The extended pen with the style array.
  1191. } EMREXTCREATEPEN, *PEMREXTCREATEPEN;
  1192.  
  1193. typedef struct EMRCREATEBRUSHINDIRECT {
  1194.     EMR     emr;
  1195.     DWORD   ihBrush;            // Brush handle index
  1196.     LOGBRUSH lb;                // The style must be BS_SOLID, BS_HOLLOW,
  1197.                                 // BS_NULL or BS_HATCHED.
  1198. } EMRCREATEBRUSHINDIRECT, *PEMRCREATEBRUSHINDIRECT;
  1199.  
  1200. typedef struct EMRCREATEMONOBRUSH {
  1201.     EMR     emr;
  1202.     DWORD   ihBrush;            // Brush handle index
  1203.     DWORD   iUsage;             // Bitmap info color table usage
  1204.     DWORD   offBmi;             // Offset to the BITMAPINFO structure
  1205.     DWORD   cbBmi;              // Size of the BITMAPINFO structure
  1206.     DWORD   offBits;            // Offset to the bitmap bits
  1207.     DWORD   cbBits;             // Size of the bitmap bits
  1208. } EMRCREATEMONOBRUSH, *PEMRCREATEMONOBRUSH;
  1209.  
  1210. typedef struct EMRCREATEDIBPATTERNBRUSHPT {
  1211.     EMR     emr;
  1212.     DWORD   ihBrush;            // Brush handle index
  1213.     DWORD   iUsage;             // Bitmap info color table usage
  1214.     DWORD   offBmi;             // Offset to the BITMAPINFO structure
  1215.     DWORD   cbBmi;              // Size of the BITMAPINFO structure
  1216.                                 // The bitmap info is followed by the bitmap
  1217.                                 // bits to form a packed DIB.
  1218.     DWORD   offBits;            // Offset to the bitmap bits
  1219.     DWORD   cbBits;             // Size of the bitmap bits
  1220. } EMRCREATEDIBPATTERNBRUSHPT, *PEMRCREATEDIBPATTERNBRUSHPT;
  1221.  
  1222. typedef struct EMRFORMAT {
  1223.     DWORD   dSignature;         // Format signature, e.g. ENHMETA_SIGNATURE.
  1224.     DWORD   nVersion;           // Format version number.
  1225.     DWORD   cbData;             // Size of data in bytes.
  1226.     DWORD   offData;            // Offset to data from GDICOMMENT_IDENTIFIER.
  1227.                                 // It must begin at a DWORD offset.
  1228. } EMRFORMAT, *PEMRFORMAT;
  1229.  
  1230. typedef struct POINTFLOAT {
  1231.     FLOAT   x;
  1232.     FLOAT   y;
  1233. } POINTFLOAT, *PPOINTFLOAT;
  1234.  
  1235. typedef struct GLYPHMETRICSFLOAT {
  1236.     FLOAT       gmfBlackBoxX;
  1237.     FLOAT       gmfBlackBoxY;
  1238.     POINTFLOAT  gmfptGlyphOrigin;
  1239.     FLOAT       gmfCellIncX;
  1240.     FLOAT       gmfCellIncY;
  1241. } GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
  1242.  
  1243. // GDI function entries and constants
  1244. [
  1245. #ifdef UNICODE
  1246. uuid(64675044-3A82-101B-8181-00AA003743D3),
  1247. #else
  1248. uuid(64674044-3A82-101B-8181-00AA003743D3),
  1249. #endif
  1250. helpstring("Windows GDI Functions"),
  1251. dllname("GDI32.DLL")
  1252. ]
  1253. module GDI {
  1254.  
  1255.     // Binary raster ops 
  1256.     const int R2_BLACK            = 1;   //  0
  1257.     const int R2_NOTMERGEPEN      = 2;   // DPon
  1258.     const int R2_MASKNOTPEN       = 3;   // DPna
  1259.     const int R2_NOTCOPYPEN       = 4;   // PN
  1260.     const int R2_MASKPENNOT       = 5;   // PDna
  1261.     const int R2_NOT              = 6;   // Dn
  1262.     const int R2_XORPEN           = 7;   // DPx
  1263.     const int R2_NOTMASKPEN       = 8;   // DPan
  1264.     const int R2_MASKPEN          = 9;   // DPa
  1265.     const int R2_NOTXORPEN        = 10;  // DPxn
  1266.     const int R2_NOP              = 11;  // D
  1267.     const int R2_MERGENOTPEN      = 12;  // DPno
  1268.     const int R2_COPYPEN          = 13;  // P
  1269.     const int R2_MERGEPENNOT      = 14;  // PDno
  1270.     const int R2_MERGEPEN         = 15;  // DPo
  1271.     const int R2_WHITE            = 16;  //  1
  1272.     const int R2_LAST             = 16;
  1273.  
  1274.     // Ternary raster operations 
  1275.     // Ternary raster operations
  1276.     [ helpstring("BitBlt: Copy source bits over destination bits") ]
  1277.     const UINT SRCCOPY     = 0x00CC0020; // dest = source
  1278.     [ helpstring("BitBlt: OR source bits onto destination") ]
  1279.     const UINT SRCPAINT    = 0x00EE0086; // dest = source OR dest
  1280.     [ helpstring("BitBlt: AND source bits onto destination") ]
  1281.     const UINT SRCAND      = 0x008800C6; // dest = source AND dest
  1282.     [ helpstring("BitBlt: XOR source bits onto destination") ]
  1283.     const UINT SRCINVERT   = 0x00660046; // dest = source XOR dest
  1284.     [ helpstring("BitBlt: Invert destination bits, AND the result with source bits") ]
  1285.     const UINT SRCERASE    = 0x00440328; // dest = source AND (NOT dest )
  1286.     [ helpstring("BitBlt: Invert source bits, copy to destination") ]
  1287.     const UINT NOTSRCCOPY  = 0x00330008; // dest = (NOT source)
  1288.     [ helpstring("BitBlt: OR source bits onto destination bits, invert result") ]
  1289.     const UINT NOTSRCERASE = 0x001100A6; // dest = (NOT src) AND (NOT dest)
  1290.     [ helpstring("BitBlt: AND source bits onto pattern bits, copy to destination") ]
  1291.     const UINT MERGECOPY   = 0x00C000CA; // dest = (source AND pattern)
  1292.     [ helpstring("BitBlt: Invert source bits, AND result onto destination") ]
  1293.     const UINT MERGEPAINT  = 0x00BB0226; // dest = (NOT source) OR dest
  1294.     [ helpstring("BitBlt: Copy pattern bits over destination bits") ]
  1295.     const UINT PATCOPY     = 0x00F00021; // dest = pattern
  1296.     [ helpstring("BitBlt: Invert source bits, OR result with pattern, OR result with destination") ]
  1297.     const UINT PATPAINT    = 0x00FB0A09; // dest = DPSnoo
  1298.     [ helpstring("BitBlt: XOR pattern bits onto destination") ]
  1299.     const UINT PATINVERT   = 0x005A0049; // dest = pattern XOR dest
  1300.     [ helpstring("BitBlt: Invert destination bits") ]
  1301.     const UINT DSTINVERT   = 0x00550009; // dest = (NOT dest)
  1302.     [ helpstring("BitBlt: Turn destination bits black (0)") ]
  1303.     const UINT BLACKNESS   = 0x00000042; // dest = BLACK
  1304.     [ helpstring("BitBlt: Turn destination bits white (1)") ]
  1305.     const UINT WHITENESS   = 0x00FF0062; // dest = WHITE
  1306.  
  1307.     // Quaternary raster codes 
  1308.     //define MAKEROP4(fore,back) (DWORD)((((back) << 8) & = 0xFF000000) | (fore))
  1309.  
  1310.     const int GDI_ERROR             = 0xFFFFFFFFL;
  1311.     const HANDLE HGDI_ERROR         = 0xFFFFFFFFL;
  1312.  
  1313.     // Region Flags 
  1314.     const int ERROR               = 0;
  1315.     const int NULLREGION          = 1;
  1316.     const int SIMPLEREGION        = 2;
  1317.     const int COMPLEXREGION       = 3;
  1318.     const int RGN_ERROR           = 0; // ERROR
  1319.  
  1320.     // CombineRgn() Styles 
  1321.     const int RGN_AND             = 1;
  1322.     const int RGN_OR              = 2;
  1323.     const int RGN_XOR             = 3;
  1324.     const int RGN_DIFF            = 4;
  1325.     const int RGN_COPY            = 5;
  1326.     const int RGN_MIN             = 1; // RGN_AND
  1327.     const int RGN_MAX             = 5; // RGN_COPY
  1328.  
  1329.     // StretchBlt() Modes 
  1330.     const int BLACKONWHITE                 = 1;
  1331.     const int WHITEONBLACK                 = 2;
  1332.     const int COLORONCOLOR                 = 3;
  1333.     const int HALFTONE                     = 4;
  1334.     const int MAXSTRETCHBLTMODE            = 4;
  1335.  
  1336.     // new StretchBlt() Modes (simpler names)
  1337.     [ helpstring("SetStretchBltMode: AND compressed bits (preserve black) for SetStretchBltMode)") ]
  1338.     const int STRETCH_ANDSCANS   = 1;
  1339.     [ helpstring("SetStretchBltMode: OR compressed bits (preserve colored or white) for SetStretchBltMode") ]
  1340.     const int STRETCH_ORSCANS        = 2;
  1341.     [ helpstring("SetStretchBltMode: Delete compressed lines of bits for SetStretchBltMode") ]
  1342.     const int STRETCH_DELETESCANS    = 3;
  1343.  
  1344.     // PolyFill() Modes 
  1345.     const int ALTERNATE                    = 1;
  1346.     const int WINDING                      = 2;
  1347.     const int POLYFILL_LAST                = 2;
  1348.  
  1349.     // Text Alignment Options 
  1350.     const int TA_NOUPDATECP                = 0;
  1351.     const int TA_UPDATECP                  = 1;
  1352.  
  1353.     const int TA_LEFT                      = 0;
  1354.     const int TA_RIGHT                     = 2;
  1355.     const int TA_CENTER                    = 6;
  1356.  
  1357.     const int TA_TOP                       = 0;
  1358.     const int TA_BOTTOM                    = 8;
  1359.     const int TA_BASELINE                  = 24;
  1360.     const int TA_RTLREADING                = 256;
  1361.     const int TA_MASK       = 24 + 6 + 1 + 256; // (TA_BASELINE+TA_CENTER+TA_UPDATECP+TA_RTLREADING);
  1362.  
  1363.     const int VTA_BASELINE = 24; // TA_BASELINE;
  1364.     const int VTA_LEFT     = 8;  // TA_BOTTOM;
  1365.     const int VTA_RIGHT    = 0;  // TA_TOP;
  1366.     const int VTA_CENTER   = 6;  // TA_CENTER;
  1367.     const int VTA_BOTTOM   = 8;  // TA_RIGHT;
  1368.     const int VTA_TOP      = 0;  // TA_LEFT;
  1369.  
  1370.     const UINT ETO_OPAQUE                   = 0x0002;
  1371.     const UINT ETO_CLIPPED                  = 0x0004;
  1372.     const UINT ETO_GLYPH_INDEX              = 0x0010;
  1373.     const UINT ETO_RTLREADING               = 0x0080;
  1374.  
  1375.     const UINT ASPECT_FILTERING             = 0x0001;
  1376.  
  1377.     // Bounds Accumulation APIs 
  1378.  
  1379.     const UINT DCB_RESET       = 0x0001;
  1380.     const UINT DCB_ACCUMULATE  = 0x0002;
  1381.     const UINT DCB_DIRTY       = 0x0002; // DCB_ACCUMULATE
  1382.     const UINT DCB_SET         = 0x0003; // DCB_RESET | DCB_ACCUMULATE)
  1383.     const UINT DCB_ENABLE      = 0x0004;
  1384.     const UINT DCB_DISABLE     = 0x0008;
  1385.  
  1386.     // Metafile Functions 
  1387.     const UINT META_SETBKCOLOR              = 0x0201;
  1388.     const UINT META_SETBKMODE               = 0x0102;
  1389.     const UINT META_SETMAPMODE              = 0x0103;
  1390.     const UINT META_SETROP2                 = 0x0104;
  1391.     const UINT META_SETRELABS               = 0x0105;
  1392.     const UINT META_SETPOLYFILLMODE         = 0x0106;
  1393.     const UINT META_SETSTRETCHBLTMODE       = 0x0107;
  1394.     const UINT META_SETTEXTCHAREXTRA        = 0x0108;
  1395.     const UINT META_SETTEXTCOLOR            = 0x0209;
  1396.     const UINT META_SETTEXTJUSTIFICATION    = 0x020A;
  1397.     const UINT META_SETWINDOWORG            = 0x020B;
  1398.     const UINT META_SETWINDOWEXT            = 0x020C;
  1399.     const UINT META_SETVIEWPORTORG          = 0x020D;
  1400.     const UINT META_SETVIEWPORTEXT          = 0x020E;
  1401.     const UINT META_OFFSETWINDOWORG         = 0x020F;
  1402.     const UINT META_SCALEWINDOWEXT          = 0x0410;
  1403.     const UINT META_OFFSETVIEWPORTORG       = 0x0211;
  1404.     const UINT META_SCALEVIEWPORTEXT        = 0x0412;
  1405.     const UINT META_LINETO                  = 0x0213;
  1406.     const UINT META_MOVETO                  = 0x0214;
  1407.     const UINT META_EXCLUDECLIPRECT         = 0x0415;
  1408.     const UINT META_INTERSECTCLIPRECT       = 0x0416;
  1409.     const UINT META_ARC                     = 0x0817;
  1410.     const UINT META_ELLIPSE                 = 0x0418;
  1411.     const UINT META_FLOODFILL               = 0x0419;
  1412.     const UINT META_PIE                     = 0x081A;
  1413.     const UINT META_RECTANGLE               = 0x041B;
  1414.     const UINT META_ROUNDRECT               = 0x061C;
  1415.     const UINT META_PATBLT                  = 0x061D;
  1416.     const UINT META_SAVEDC                  = 0x001E;
  1417.     const UINT META_SETPIXEL                = 0x041F;
  1418.     const UINT META_OFFSETCLIPRGN           = 0x0220;
  1419.     const UINT META_TEXTOUT                 = 0x0521;
  1420.     const UINT META_BITBLT                  = 0x0922;
  1421.     const UINT META_STRETCHBLT              = 0x0B23;
  1422.     const UINT META_POLYGON                 = 0x0324;
  1423.     const UINT META_POLYLINE                = 0x0325;
  1424.     const UINT META_ESCAPE                  = 0x0626;
  1425.     const UINT META_RESTOREDC               = 0x0127;
  1426.     const UINT META_FILLREGION              = 0x0228;
  1427.     const UINT META_FRAMEREGION             = 0x0429;
  1428.     const UINT META_INVERTREGION            = 0x012A;
  1429.     const UINT META_PAINTREGION             = 0x012B;
  1430.     const UINT META_SELECTCLIPREGION        = 0x012C;
  1431.     const UINT META_SELECTOBJECT            = 0x012D;
  1432.     const UINT META_SETTEXTALIGN            = 0x012E;
  1433.     const UINT META_CHORD                   = 0x0830;
  1434.     const UINT META_SETMAPPERFLAGS          = 0x0231;
  1435.     const UINT META_EXTTEXTOUT              = 0x0a32;
  1436.     const UINT META_SETDIBTODEV             = 0x0d33;
  1437.     const UINT META_SELECTPALETTE           = 0x0234;
  1438.     const UINT META_REALIZEPALETTE          = 0x0035;
  1439.     const UINT META_ANIMATEPALETTE          = 0x0436;
  1440.     const UINT META_SETPALENTRIES           = 0x0037;
  1441.     const UINT META_POLYPOLYGON             = 0x0538;
  1442.     const UINT META_RESIZEPALETTE           = 0x0139;
  1443.     const UINT META_DIBBITBLT               = 0x0940;
  1444.     const UINT META_DIBSTRETCHBLT           = 0x0b41;
  1445.     const UINT META_DIBCREATEPATTERNBRUSH   = 0x0142;
  1446.     const UINT META_STRETCHDIB              = 0x0f43;
  1447.     const UINT META_EXTFLOODFILL            = 0x0548;
  1448.     const UINT META_DELETEOBJECT            = 0x01f0;
  1449.     const UINT META_CREATEPALETTE           = 0x00f7;
  1450.     const UINT META_CREATEPATTERNBRUSH      = 0x01F9;
  1451.     const UINT META_CREATEPENINDIRECT       = 0x02FA;
  1452.     const UINT META_CREATEFONTINDIRECT      = 0x02FB;
  1453.     const UINT META_CREATEBRUSHINDIRECT     = 0x02FC;
  1454.     const UINT META_CREATEREGION            = 0x06FF;
  1455.  
  1456.     // GDI Escapes 
  1457.     const int ESC_NEWFRAME                  = 1;
  1458.     const int ESC_ABORTDOC                  = 2;
  1459.     const int ESC_NEXTBAND                  = 3;
  1460.     const int ESC_SETCOLORTABLE             = 4;
  1461.     const int ESC_GETCOLORTABLE             = 5;
  1462.     const int ESC_FLUSHOUTPUT               = 6;
  1463.     const int ESC_DRAFTMODE                 = 7;
  1464.     const int ESC_QUERYESCSUPPORT           = 8;
  1465.     const int ESC_SETABORTPROC              = 9;
  1466.     const int ESC_STARTDOC                  = 10;
  1467.     const int ESC_ENDDOC                    = 11;
  1468.     const int ESC_GETPHYSPAGESIZE           = 12;
  1469.     const int ESC_GETPRINTINGOFFSET         = 13;
  1470.     const int ESC_GETSCALINGFACTOR          = 14;
  1471.     const int ESC_MFCOMMENT                 = 15;
  1472.     const int ESC_GETPENWIDTH               = 16;
  1473.     const int ESC_SETCOPYCOUNT              = 17;
  1474.     const int ESC_SELECTPAPERSOURCE         = 18;
  1475.     const int ESC_DEVICEDATA                = 19;
  1476.     const int ESC_PASSTHROUGH               = 19;
  1477.     const int ESC_GETTECHNOLGY              = 20;
  1478.     const int ESC_GETTECHNOLOGY             = 20;
  1479.     const int ESC_SETLINECAP                = 21;
  1480.     const int ESC_SETLINEJOIN               = 22;
  1481.     const int ESC_SETMITERLIMIT             = 23;
  1482.     const int ESC_BANDINFO                  = 24;
  1483.     const int ESC_DRAWPATTERNRECT           = 25;
  1484.     const int ESC_GETVECTORPENSIZE          = 26;
  1485.     const int ESC_GETVECTORBRUSHSIZE        = 27;
  1486.     const int ESC_ENABLEDUPLEX              = 28;
  1487.     const int ESC_GETSETPAPERBINS           = 29;
  1488.     const int ESC_GETSETPRINTORIENT         = 30;
  1489.     const int ESC_ENUMPAPERBINS             = 31;
  1490.     const int ESC_SETDIBSCALING             = 32;
  1491.     const int ESC_EPSPRINTING               = 33;
  1492.     const int ESC_ENUMPAPERMETRICS          = 34;
  1493.     const int ESC_GETSETPAPERMETRICS        = 35;
  1494.     const int ESC_POSTSCRIPT_DATA           = 37;
  1495.     const int ESC_POSTSCRIPT_IGNORE         = 38;
  1496.     const int ESC_MOUSETRAILS               = 39;
  1497.     const int ESC_GETDEVICEUNITS            = 42;
  1498.  
  1499.     const int ESC_GETEXTENDEDTEXTMETRICS    = 256;
  1500.     const int ESC_GETEXTENTTABLE            = 257;
  1501.     const int ESC_GETPAIRKERNTABLE          = 258;
  1502.     const int ESC_GETTRACKKERNTABLE         = 259;
  1503.     const int ESC_EXTTEXTOUT                = 512;
  1504.     const int ESC_GETFACENAME               = 513;
  1505.     const int ESC_DOWNLOADFACE              = 514;
  1506.     const int ESC_ENABLERELATIVEWIDTHS      = 768;
  1507.     const int ESC_ENABLEPAIRKERNING         = 769;
  1508.     const int ESC_SETKERNTRACK              = 770;
  1509.     const int ESC_SETALLJUSTVALUES          = 771;
  1510.     const int ESC_SETCHARSET                = 772;
  1511.  
  1512.     const int ESC_STRETCHBLT                = 2048;
  1513.     const int ESC_GETSETSCREENPARAMS        = 3072;
  1514.     const int ESC_QUERYDIBSUPPORT           = 3073;
  1515.     const int ESC_BEGIN_PATH                = 4096;
  1516.     const int ESC_CLIP_TO_PATH              = 4097;
  1517.     const int ESC_END_PATH                  = 4098;
  1518.     const int ESC_EXT_DEVICE_CAPS           = 4099;
  1519.     const int ESC_RESTORE_CTM               = 4100;
  1520.     const int ESC_SAVE_CTM                  = 4101;
  1521.     const int ESC_SET_ARC_DIRECTION         = 4102;
  1522.     const int ESC_SET_BACKGROUND_COLOR      = 4103;
  1523.     const int ESC_SET_POLY_MODE             = 4104;
  1524.     const int ESC_SET_SCREEN_ANGLE          = 4105;
  1525.     const int ESC_SET_SPREAD                = 4106;
  1526.     const int ESC_TRANSFORM_CTM             = 4107;
  1527.     const int ESC_SET_CLIP_BOX              = 4108;
  1528.     const int ESC_SET_BOUNDS                = 4109;
  1529.     const int ESC_SET_MIRROR_MODE           = 4110;
  1530.     const int ESC_OPENCHANNEL               = 4110;
  1531.     const int ESC_DOWNLOADHEADER            = 4111;
  1532.     const int ESC_CLOSECHANNEL              = 4112;
  1533.     const int ESC_POSTSCRIPT_PASSTHROUGH    = 4115;
  1534.     const int ESC_ENCAPSULATED_POSTSCRIPT   = 4116;
  1535.  
  1536.     // Flag returned from QUERYDIBSUPPORT
  1537.     const int QDI_SETDIBITS                = 1;
  1538.     const int QDI_GETDIBITS                = 2;
  1539.     const int QDI_DIBTOSCREEN              = 4;
  1540.     const int QDI_STRETCHDIB               = 8;
  1541.  
  1542.     // Spooler Error Codes
  1543.     const int SP_NOTREPORTED               = 0x4000;
  1544.     const int SP_ERROR                     = -1;
  1545.     const int SP_APPABORT                  = -2;
  1546.     const int SP_USERABORT                 = -3;
  1547.     const int SP_OUTOFDISK                 = -4;
  1548.     const int SP_OUTOFMEMORY               = -5;
  1549.  
  1550.     const UINT PR_JOBSTATUS                = 0x0000;
  1551.  
  1552.     // Object Definitions for EnumObjects() 
  1553.     const int OBJ_PEN             = 1;
  1554.     const int OBJ_BRUSH           = 2;
  1555.     const int OBJ_DC              = 3;
  1556.     const int OBJ_METADC          = 4;
  1557.     const int OBJ_PAL             = 5;
  1558.     const int OBJ_FONT            = 6;
  1559.     const int OBJ_BITMAP          = 7;
  1560.     const int OBJ_REGION          = 8;
  1561.     const int OBJ_METAFILE        = 9;
  1562.     const int OBJ_MEMDC           = 10;
  1563.     const int OBJ_EXTPEN          = 11;
  1564.     const int OBJ_ENHMETADC       = 12;
  1565.     const int OBJ_ENHMETAFILE     = 13;
  1566.  
  1567.     // xform stuff 
  1568.     const int MWT_IDENTITY        = 1;
  1569.     const int MWT_LEFTMULTIPLY    = 2;
  1570.     const int MWT_RIGHTMULTIPLY   = 3;
  1571.  
  1572.     const int MWT_MIN             = 1; // MWT_IDENTITY
  1573.     const int MWT_MAX             = 3; // MWT_RIGHTMULTIPLY
  1574.  
  1575.     // Image Color Matching color definitions 
  1576.  
  1577.     const UINT LCS_CALIBRATED_RGB        = 0x00000000L;
  1578.     const UINT LCS_DEVICE_RGB            = 0x00000001L;
  1579.     const UINT LCS_DEVICE_CMYK           = 0x00000002L;
  1580.  
  1581.     const UINT LCS_GM_BUSINESS           = 0x00000001L;
  1582.     const UINT LCS_GM_GRAPHICS           = 0x00000002L;
  1583.     const UINT LCS_GM_IMAGES             = 0x00000004L;
  1584.  
  1585.     // ICM Defines for results from CheckColorInGamut() 
  1586.     const int CM_OUT_OF_GAMUT       = 255;
  1587.     const int CM_IN_GAMUT           = 0;
  1588.  
  1589.     // Macros to retrieve CMYK values from a COLORREF clrref 
  1590.     //define GetCValue(cmyk)      ((BYTE)(cmyk))
  1591.     //define GetMValue(cmyk)      ((BYTE)((cmyk)>> 8))
  1592.     //define GetYValue(cmyk)      ((BYTE)((cmyk)>>16))
  1593.     //define GetKValue(cmyk)      ((BYTE)((cmyk)>>24))
  1594.  
  1595.     //define CMYK(c,m,y,k)       ((COLORREF clrref)((((BYTE)(c)|((WORD)((BYTE)(m))<<8))|(((DWORD)(BYTE)(y))<<16))|(((DWORD)(BYTE)(k))<<24)))
  1596.  
  1597.     // constants for the biCompression field 
  1598.     const int BI_RGB        = 0L;
  1599.     const int BI_RLE8       = 1L;
  1600.     const int BI_RLE4       = 2L;
  1601.     const int BI_BITFIELDS  = 3L;
  1602.  
  1603.     const int TCI_SRCCHARSET    = 1;
  1604.     const int TCI_SRCCODEPAGE   = 2;
  1605.     const int TCI_SRCFONTSIG    = 3;
  1606.  
  1607.     // tmPitchAndFamily flags 
  1608.     const int TMPF_FIXED_PITCH    = 0x01;
  1609.     const int TMPF_VECTOR         = 0x02;
  1610.     const int TMPF_DEVICE         = 0x08;
  1611.     const int TMPF_TRUETYPE       = 0x04;
  1612.  
  1613.     // ntmFlags field flags 
  1614.     const int NTM_REGULAR     = 0x00000040L;
  1615.     const int NTM_BOLD        = 0x00000020L;
  1616.     const int NTM_ITALIC      = 0x00000001L;
  1617.  
  1618.     // Logical Font 
  1619.     const int LF_FACESIZE         = 32;
  1620.  
  1621.     const int LF_FULLFACESIZE     = 64;
  1622.  
  1623.     const int OUT_DEFAULT_PRECIS      = 0;
  1624.     const int OUT_STRING_PRECIS       = 1;
  1625.     const int OUT_CHARACTER_PRECIS    = 2;
  1626.     const int OUT_STROKE_PRECIS       = 3;
  1627.     const int OUT_TT_PRECIS           = 4;
  1628.     const int OUT_DEVICE_PRECIS       = 5;
  1629.     const int OUT_RASTER_PRECIS       = 6;
  1630.     const int OUT_TT_ONLY_PRECIS      = 7;
  1631.     const int OUT_OUTLINE_PRECIS      = 8;
  1632.  
  1633.     const UINT CLIP_DEFAULT_PRECIS     = 0x00;
  1634.     const UINT CLIP_CHARACTER_PRECIS   = 0x01;
  1635.     const UINT CLIP_STROKE_PRECIS      = 0x02;
  1636.     const UINT CLIP_MASK               = 0x0f;
  1637.     const UINT CLIP_LH_ANGLES          = 0x04; // (1<<4)
  1638.     const UINT CLIP_TT_ALWAYS          = 0x40; // (2<<4)
  1639.     const UINT CLIP_EMBEDDED           = 0x80; // (8<<4)
  1640.  
  1641.     const int DEFAULT_QUALITY         = 0;
  1642.     const int DRAFT_QUALITY           = 1;
  1643.     const int PROOF_QUALITY           = 2;
  1644.     const int NONANTIALIASED_QUALITY  = 3;
  1645.     const int ANTIALIASED_QUALITY     = 4;
  1646.  
  1647.     const int DEFAULT_PITCH           = 0;
  1648.     const int FIXED_PITCH             = 1;
  1649.     const int VARIABLE_PITCH          = 2;
  1650.     const int MONO_FONT               = 8;
  1651.  
  1652.     const int ANSI_CHARSET            = 0;
  1653.     const int DEFAULT_CHARSET         = 1;
  1654.     const int SYMBOL_CHARSET          = 2;
  1655.     const int SHIFTJIS_CHARSET        = 128;
  1656.     const int HANGEUL_CHARSET         = 129;
  1657.     const int GB2312_CHARSET          = 134;
  1658.     const int CHINESEBIG5_CHARSET     = 136;
  1659.     const int OEM_CHARSET             = 255;
  1660.     const int JOHAB_CHARSET           = 130;
  1661.     const int HEBREW_CHARSET          = 177;
  1662.     const int ARABIC_CHARSET          = 178;
  1663.     const int GREEK_CHARSET           = 161;
  1664.     const int TURKISH_CHARSET         = 162;
  1665.     const int THAI_CHARSET            = 222;
  1666.     const int EASTEUROPE_CHARSET      = 238;
  1667.     const int RUSSIAN_CHARSET         = 204;
  1668.  
  1669.     const int MAC_CHARSET             = 77;
  1670.     const int BALTIC_CHARSET          = 186;
  1671.  
  1672.     const UINT FS_LATIN1         = 0x00000001L;
  1673.     const UINT FS_LATIN2         = 0x00000002L;
  1674.     const UINT FS_CYRILLIC       = 0x00000004L;
  1675.     const UINT FS_GREEK          = 0x00000008L;
  1676.     const UINT FS_TURKISH        = 0x00000010L;
  1677.     const UINT FS_HEBREW         = 0x00000020L;
  1678.     const UINT FS_ARABIC         = 0x00000040L;
  1679.     const UINT FS_BALTIC         = 0x00000080L;
  1680.     const UINT FS_THAI           = 0x00010000L;
  1681.     const UINT FS_JISJAPAN       = 0x00020000L;
  1682.     const UINT FS_CHINESESIMP    = 0x00040000L;
  1683.     const UINT FS_WANSUNG        = 0x00080000L;
  1684.     const UINT FS_CHINESETRAD    = 0x00100000L;
  1685.     const UINT FS_JOHAB          = 0x00200000L;
  1686.     const UINT FS_SYMBOL         = 0x80000000L;
  1687.  
  1688.     // Font Families 
  1689.     const UINT FF_DONTCARE       = 0x00; // (0<<4)  Don't care or don't know.
  1690.     const UINT FF_ROMAN          = 0x14; // (1<<4)  Variable stroke width, serifed.
  1691.                                          //         Times Roman, Century Schoolbook, etc.
  1692.     const UINT FF_SWISS          = 0x20; // (2<<4)  Variable stroke width, sans-serifed.
  1693.                                          //         Helvetica, Swiss, etc.
  1694.     const UINT FF_MODERN         = 0x30; // (3<<4)  Constant stroke width, serifed or sans-serifed.
  1695.                                          //         Pica, Elite, Courier, etc.
  1696.     const UINT FF_SCRIPT         = 0x40; // (4<<4)  Cursive, etc.
  1697.     const UINT FF_DECORATIVE     = 0x50; // (5<<4)  Old English, etc.
  1698.  
  1699.     // Font Weights 
  1700.     const int FW_DONTCARE         = 0;
  1701.     const int FW_THIN             = 100;
  1702.     const int FW_EXTRALIGHT       = 200;
  1703.     const int FW_LIGHT            = 300;
  1704.     const int FW_NORMAL           = 400;
  1705.     const int FW_MEDIUM           = 500;
  1706.     const int FW_SEMIBOLD         = 600;
  1707.     const int FW_BOLD             = 700;
  1708.     const int FW_EXTRABOLD        = 800;
  1709.     const int FW_HEAVY            = 900;
  1710.  
  1711.     const int FW_ULTRALIGHT       = 200; // FW_EXTRALIGHT
  1712.     const int FW_REGULAR          = 400; // FW_NORMAL
  1713.     const int FW_DEMIBOLD         = 600; // FW_SEMIBOLD
  1714.     const int FW_ULTRABOLD        = 800; // FW_EXTRABOLD
  1715.     const int FW_BLACK            = 900; // FW_HEAVY
  1716.  
  1717.     const int PANOSE_COUNT                = 10;
  1718.     const int PAN_FAMILYTYPE_INDEX        = 0;
  1719.     const int PAN_SERIFSTYLE_INDEX        = 1;
  1720.     const int PAN_WEIGHT_INDEX            = 2;
  1721.     const int PAN_PROPORTION_INDEX        = 3;
  1722.     const int PAN_CONTRAST_INDEX          = 4;
  1723.     const int PAN_STROKEVARIATION_INDEX   = 5;
  1724.     const int PAN_ARMSTYLE_INDEX          = 6;
  1725.     const int PAN_LETTERFORM_INDEX        = 7;
  1726.     const int PAN_MIDLINE_INDEX           = 8;
  1727.     const int PAN_XHEIGHT_INDEX           = 9;
  1728.  
  1729.     const int PAN_CULTURE_LATIN           = 0;
  1730.  
  1731.     const int PAN_ANY                         = 0;  // Any
  1732.     const int PAN_NO_FIT                      = 1;  // No Fit
  1733.  
  1734.     const int PAN_FAMILY_TEXT_DISPLAY         = 2;  // Text and Display
  1735.     const int PAN_FAMILY_SCRIPT               = 3;  // Script
  1736.     const int PAN_FAMILY_DECORATIVE           = 4;  // Decorative
  1737.     const int PAN_FAMILY_PICTORIAL            = 5;  // Pictorial
  1738.  
  1739.     const int PAN_SERIF_COVE                  = 2;  // Cove
  1740.     const int PAN_SERIF_OBTUSE_COVE           = 3;  // Obtuse Cove
  1741.     const int PAN_SERIF_SQUARE_COVE           = 4;  // Square Cove
  1742.     const int PAN_SERIF_OBTUSE_SQUARE_COVE    = 5;  // Obtuse Square Cove
  1743.     const int PAN_SERIF_SQUARE                = 6;  // Square
  1744.     const int PAN_SERIF_THIN                  = 7;  // Thin
  1745.     const int PAN_SERIF_BONE                  = 8;  // Bone
  1746.     const int PAN_SERIF_EXAGGERATED           = 9;  // Exaggerated
  1747.     const int PAN_SERIF_TRIANGLE              = 10; // Triangle
  1748.     const int PAN_SERIF_NORMAL_SANS           = 11; // Normal Sans
  1749.     const int PAN_SERIF_OBTUSE_SANS           = 12; // Obtuse Sans
  1750.     const int PAN_SERIF_PERP_SANS             = 13; // Prep Sans
  1751.     const int PAN_SERIF_FLARED                = 14; // Flared
  1752.     const int PAN_SERIF_ROUNDED               = 15; // Rounded
  1753.  
  1754.     const int PAN_WEIGHT_VERY_LIGHT           = 2;  // Very Light
  1755.     const int PAN_WEIGHT_LIGHT                = 3;  // Light
  1756.     const int PAN_WEIGHT_THIN                 = 4;  // Thin
  1757.     const int PAN_WEIGHT_BOOK                 = 5;  // Book
  1758.     const int PAN_WEIGHT_MEDIUM               = 6;  // Medium
  1759.     const int PAN_WEIGHT_DEMI                 = 7;  // Demi
  1760.     const int PAN_WEIGHT_BOLD                 = 8;  // Bold
  1761.     const int PAN_WEIGHT_HEAVY                = 9;  // Heavy
  1762.     const int PAN_WEIGHT_BLACK                = 10; // Black
  1763.     const int PAN_WEIGHT_NORD                 = 11; // Nord
  1764.  
  1765.     const int PAN_PROP_OLD_STYLE              = 2;  // Old Style
  1766.     const int PAN_PROP_MODERN                 = 3;  // Modern
  1767.     const int PAN_PROP_EVEN_WIDTH             = 4;  // Even Width
  1768.     const int PAN_PROP_EXPANDED               = 5;  // Expanded
  1769.     const int PAN_PROP_CONDENSED              = 6;  // Condensed
  1770.     const int PAN_PROP_VERY_EXPANDED          = 7;  // Very Expanded
  1771.     const int PAN_PROP_VERY_CONDENSED         = 8;  // Very Condensed
  1772.     const int PAN_PROP_MONOSPACED             = 9;  // Monospaced
  1773.  
  1774.     const int PAN_CONTRAST_NONE               = 2;  // None
  1775.     const int PAN_CONTRAST_VERY_LOW           = 3;  // Very Low
  1776.     const int PAN_CONTRAST_LOW                = 4;  // Low
  1777.     const int PAN_CONTRAST_MEDIUM_LOW         = 5;  // Medium Low
  1778.     const int PAN_CONTRAST_MEDIUM             = 6;  // Medium
  1779.     const int PAN_CONTRAST_MEDIUM_HIGH        = 7;  // Mediim High
  1780.     const int PAN_CONTRAST_HIGH               = 8;  // High
  1781.     const int PAN_CONTRAST_VERY_HIGH          = 9;  // Very High
  1782.  
  1783.     const int PAN_STROKE_GRADUAL_DIAG         = 2;  // Gradual/Diagonal
  1784.     const int PAN_STROKE_GRADUAL_TRAN         = 3;  // Gradual/Transitional
  1785.     const int PAN_STROKE_GRADUAL_VERT         = 4;  // Gradual/Vertical
  1786.     const int PAN_STROKE_GRADUAL_HORZ         = 5;  // Gradual/Horizontal
  1787.     const int PAN_STROKE_RAPID_VERT           = 6;  // Rapid/Vertical
  1788.     const int PAN_STROKE_RAPID_HORZ           = 7;  // Rapid/Horizontal
  1789.     const int PAN_STROKE_INSTANT_VERT         = 8;  // Instant/Vertical
  1790.  
  1791.     const int PAN_STRAIGHT_ARMS_HORZ          = 2;  // Straight Arms/Horizontal
  1792.     const int PAN_STRAIGHT_ARMS_WEDGE         = 3;  // Straight Arms/Wedge
  1793.     const int PAN_STRAIGHT_ARMS_VERT          = 4;  // Straight Arms/Vertical
  1794.     const int PAN_STRAIGHT_ARMS_SINGLE_SERIF  = 5;  // Straight Arms/Single-Serif
  1795.     const int PAN_STRAIGHT_ARMS_DOUBLE_SERIF  = 6;  // Straight Arms/Double-Serif
  1796.     const int PAN_BENT_ARMS_HORZ              = 7;  // Non-Straight Arms/Horizontal
  1797.     const int PAN_BENT_ARMS_WEDGE             = 8;  // Non-Straight Arms/Wedge
  1798.     const int PAN_BENT_ARMS_VERT              = 9;  // Non-Straight Arms/Vertical
  1799.     const int PAN_BENT_ARMS_SINGLE_SERIF      = 10; // Non-Straight Arms/Single-Serif
  1800.     const int PAN_BENT_ARMS_DOUBLE_SERIF      = 11; // Non-Straight Arms/Double-Serif
  1801.  
  1802.     const int PAN_LETT_NORMAL_CONTACT         = 2;  // Normal/Contact
  1803.     const int PAN_LETT_NORMAL_WEIGHTED        = 3;  // Normal/Weighted
  1804.     const int PAN_LETT_NORMAL_BOXED           = 4;  // Normal/Boxed
  1805.     const int PAN_LETT_NORMAL_FLATTENED       = 5;  // Normal/Flattened
  1806.     const int PAN_LETT_NORMAL_ROUNDED         = 6;  // Normal/Rounded
  1807.     const int PAN_LETT_NORMAL_OFF_CENTER      = 7;  // Normal/Off Center
  1808.     const int PAN_LETT_NORMAL_SQUARE          = 8;  // Normal/Square
  1809.     const int PAN_LETT_OBLIQUE_CONTACT        = 9;  // Oblique/Contact
  1810.     const int PAN_LETT_OBLIQUE_WEIGHTED       = 10; // Oblique/Weighted
  1811.     const int PAN_LETT_OBLIQUE_BOXED          = 11; // Oblique/Boxed
  1812.     const int PAN_LETT_OBLIQUE_FLATTENED      = 12; // Oblique/Flattened
  1813.     const int PAN_LETT_OBLIQUE_ROUNDED        = 13; // Oblique/Rounded
  1814.     const int PAN_LETT_OBLIQUE_OFF_CENTER     = 14; // Oblique/Off Center
  1815.     const int PAN_LETT_OBLIQUE_SQUARE         = 15; // Oblique/Square
  1816.  
  1817.     const int PAN_MIDLINE_STANDARD_TRIMMED    = 2;  // Standard/Trimmed
  1818.     const int PAN_MIDLINE_STANDARD_POINTED    = 3;  // Standard/Pointed
  1819.     const int PAN_MIDLINE_STANDARD_SERIFED    = 4;  // Standard/Serifed
  1820.     const int PAN_MIDLINE_HIGH_TRIMMED        = 5;  // High/Trimmed
  1821.     const int PAN_MIDLINE_HIGH_POINTED        = 6;  // High/Pointed
  1822.     const int PAN_MIDLINE_HIGH_SERIFED        = 7;  // High/Serifed
  1823.     const int PAN_MIDLINE_CONSTANT_TRIMMED    = 8;  // Constant/Trimmed
  1824.     const int PAN_MIDLINE_CONSTANT_POINTED    = 9;  // Constant/Pointed
  1825.     const int PAN_MIDLINE_CONSTANT_SERIFED    = 10; // Constant/Serifed
  1826.     const int PAN_MIDLINE_LOW_TRIMMED         = 11; // Low/Trimmed
  1827.     const int PAN_MIDLINE_LOW_POINTED         = 12; // Low/Pointed
  1828.     const int PAN_MIDLINE_LOW_SERIFED         = 13; // Low/Serifed
  1829.  
  1830.     const int PAN_XHEIGHT_CONSTANT_SMALL      = 2;  // Constant/Small
  1831.     const int PAN_XHEIGHT_CONSTANT_STD        = 3;  // Constant/Standard
  1832.     const int PAN_XHEIGHT_CONSTANT_LARGE      = 4;  // Constant/Large
  1833.     const int PAN_XHEIGHT_DUCKING_SMALL       = 5;  // Ducking/Small
  1834.     const int PAN_XHEIGHT_DUCKING_STD         = 6;  // Ducking/Standard
  1835.     const int PAN_XHEIGHT_DUCKING_LARGE       = 7;  // Ducking/Large
  1836.  
  1837.  
  1838.     const int ELF_VENDOR_SIZE     = 4;
  1839.                                   
  1840.     const int ELF_VERSION         = 0;
  1841.     const int ELF_CULTURE_LATIN   = 0;
  1842.  
  1843.     // EnumFonts Masks 
  1844.     const UINT RASTER_FONTTYPE     = 0x0001;
  1845.     const UINT DEVICE_FONTTYPE     = 0x0002;
  1846.     const UINT TRUETYPE_FONTTYPE   = 0x0004;
  1847.  
  1848.     //define RGB(r,g,b)          ((COLORREF clrref)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)))
  1849.     //define PALETTERGB(r,g,b)   (0x02000000 | RGB(r,g,b))
  1850.     //define PALETTEINDEX(i)     ((COLORREF clrref)(0x01000000 | (DWORD)(WORD)(i)))
  1851.  
  1852.     // palette entry flags 
  1853.  
  1854.     const UINT PC_RESERVED     = 0x01;    // palette index used for animation
  1855.     const UINT PC_EXPLICIT     = 0x02;    // palette index is explicit to device
  1856.     const UINT PC_NOCOLLAPSE   = 0x04;    // do not match color to system palette
  1857.  
  1858.     //define GetRValue(rgb)      ((BYTE)(rgb))
  1859.     //define GetGValue(rgb)      ((BYTE)(((WORD)(rgb)) >> 8))
  1860.     //define GetBValue(rgb)      ((BYTE)((rgb)>>16))
  1861.  
  1862.     // Background Modes
  1863.     [ helpstring("Get/SetBkMode: Transparent background") ]
  1864.     const int TRANSPARENT    = 1;
  1865.     [ helpstring("Get/SetBkMode: Opaque background") ]
  1866.     const int OPAQUE         = 2;
  1867.     [ helpstring("Get/SetBkMode: Transparent background for blits (requires C1_TRANSPARENT device capability)") ]
  1868.     const int NEWTRANSPARENT = 3;
  1869.  
  1870.     // Graphics Modes 
  1871.  
  1872.     const int GM_COMPATIBLE       = 1;
  1873.     const int GM_ADVANCED         = 2;
  1874.     const int GM_LAST             = 2;
  1875.  
  1876.     // PolyDraw and GetPath point types 
  1877.     const UINT PT_CLOSEFIGURE      = 0x01;
  1878.     const UINT PT_LINETO           = 0x02;
  1879.     const UINT PT_BEZIERTO         = 0x04;
  1880.     const UINT PT_MOVETO           = 0x06;
  1881.  
  1882.     // Mapping Modes 
  1883.     const int MM_TEXT             = 1;
  1884.     const int MM_LOMETRIC         = 2;
  1885.     const int MM_HIMETRIC         = 3;
  1886.     const int MM_LOENGLISH        = 4;
  1887.     const int MM_HIENGLISH        = 5;
  1888.     const int MM_TWIPS            = 6;
  1889.     const int MM_ISOTROPIC        = 7;
  1890.     const int MM_ANISOTROPIC      = 8;
  1891.  
  1892.     // Min and Max Mapping Mode values 
  1893.     const int MM_MIN              = 1; // MM_TEXT
  1894.     const int MM_MAX              = 8; // MM_ANISOTROPIC
  1895.     const int MM_MAX_FIXEDSCALE   = 6; // MM_TWIPS
  1896.  
  1897.     // Coordinate Modes 
  1898.     const int ABSOLUTE            = 1;
  1899.     const int RELATIVE            = 2;
  1900.  
  1901.     // Stock Logical Objects 
  1902.     const int WHITE_BRUSH         = 0;
  1903.     const int LTGRAY_BRUSH        = 1;
  1904.     const int GRAY_BRUSH          = 2;
  1905.     const int DKGRAY_BRUSH        = 3;
  1906.     const int BLACK_BRUSH         = 4;
  1907.     const int NULL_BRUSH          = 5;
  1908.     const int HOLLOW_BRUSH        = 5; // NULL_BRUSH
  1909.     const int WHITE_PEN           = 6;
  1910.     const int BLACK_PEN           = 7;
  1911.     const int NULL_PEN            = 8;
  1912.     const int OEM_FIXED_FONT      = 10;
  1913.     const int ANSI_FIXED_FONT     = 11;
  1914.     const int ANSI_VAR_FONT       = 12;
  1915.     const int SYSTEM_FONT         = 13;
  1916.     const int DEVICE_DEFAULT_FONT = 14;
  1917.     const int DEFAULT_PALETTE     = 15;
  1918.     const int SYSTEM_FIXED_FONT   = 16;
  1919.     const int DEFAULT_GUI_FONT    = 17;
  1920.  
  1921.     const UINT CLR_INVALID     = 0xFFFFFFFF;
  1922.  
  1923.     // Brush Styles 
  1924.     const int BS_SOLID            = 0;
  1925.     const int BS_NULL             = 1;
  1926.     const int BS_HOLLOW           = 1; // BS_NULL
  1927.     const int BS_HATCHED          = 2;
  1928.     const int BS_PATTERN          = 3;
  1929.     const int BS_INDEXED          = 4;
  1930.     const int BS_DIBPATTERN       = 5;
  1931.     const int BS_DIBPATTERNPT     = 6;
  1932.     const int BS_PATTERN8X8       = 7;
  1933.     const int BS_DIBPATTERN8X8    = 8;
  1934.  
  1935.     // Hatch Styles 
  1936.     const int HS_HORIZONTAL       = 0;      // -----
  1937.     const int HS_VERTICAL         = 1;      // |||||
  1938.     const int HS_FDIAGONAL        = 2;      //
  1939.     const int HS_BDIAGONAL        = 3;      //
  1940.     const int HS_CROSS            = 4;      // +++++
  1941.     const int HS_DIAGCROSS        = 5;      // xxxxx
  1942.  
  1943.     // Pen Styles 
  1944.     const int PS_SOLID            = 0;
  1945.     const int PS_DASH             = 1;      // -------
  1946.     const int PS_DOT              = 2;      // .......
  1947.     const int PS_DASHDOT          = 3;      // _._._._
  1948.     const int PS_DASHDOTDOT       = 4;      // _.._.._
  1949.     const int PS_NULL             = 5;
  1950.     const int PS_INSIDEFRAME      = 6;
  1951.     const int PS_USERSTYLE        = 7;
  1952.     const int PS_ALTERNATE        = 8;
  1953.     const int PS_STYLE_MASK       = 0x0000000F;
  1954.  
  1955.     const int PS_ENDCAP_ROUND     = 0x00000000;
  1956.     const int PS_ENDCAP_SQUARE    = 0x00000100;
  1957.     const int PS_ENDCAP_FLAT      = 0x00000200;
  1958.     const int PS_ENDCAP_MASK      = 0x00000F00;
  1959.  
  1960.     const int PS_JOIN_ROUND       = 0x00000000;
  1961.     const int PS_JOIN_BEVEL       = 0x00001000;
  1962.     const int PS_JOIN_MITER       = 0x00002000;
  1963.     const int PS_JOIN_MASK        = 0x0000F000;
  1964.  
  1965.     const int PS_COSMETIC         = 0x00000000;
  1966.     const int PS_GEOMETRIC        = 0x00010000;
  1967.     const int PS_TYPE_MASK        = 0x000F0000;
  1968.  
  1969.     [ helpstring("SetArcDirection: Draw arc or rectangle counterclockwise") ]
  1970.     const UINT AD_COUNTERCLOCKWISE = 1;
  1971.     [ helpstring("SetArcDirection: Draw arc or rectangle clockwise") ]
  1972.     const UINT AD_CLOCKWISE        = 2;
  1973.  
  1974.     // Device Parameters for GetDeviceCaps() 
  1975.     [ helpstring("GetDeviceCaps: Version number") ]
  1976.     const int DRIVERVERSION = 0;
  1977.     [ helpstring("GetDeviceCaps: Device type returns DT_PLOTTER, DT_RASDISPLAY, DT_RASPRINTER, DT_RASCAMERA, DT_CHARSTREAM, DT_METAFILE, or DT_DISPFILE ") ]
  1978.     const int TECHNOLOGY    = 2;
  1979.     [ helpstring("GetDeviceCaps: Width of display in millimeters") ]
  1980.     const int HORZSIZE      = 4;
  1981.     [ helpstring("GetDeviceCaps: Height of display in millimeters") ]
  1982.     const int VERTSIZE      = 6;
  1983.     [ helpstring("GetDeviceCaps: Width of display in pixels") ]
  1984.     const int HORZRES       = 8;
  1985.     [ helpstring("GetDeviceCaps: Height of display in raster lines") ]
  1986.     const int VERTRES       = 10;
  1987.     [ helpstring("GetDeviceCaps: Color bits per pixel") ]
  1988.     const int BITSPIXEL     = 12;
  1989.     [ helpstring("GetDeviceCaps: Color planes") ]
  1990.     const int PLANES        = 14;
  1991.     [ helpstring("GetDeviceCaps: Number of device-specific brushes") ]
  1992.     const int NUMBRUSHES    = 16;
  1993.     [ helpstring("GetDeviceCaps: Number of device-specific pens") ]
  1994.     const int NUMPENS       = 18;
  1995.     [ helpstring("GetDeviceCaps: Number of device-specific markers") ]
  1996.     const int NUMMARKERS    = 20;
  1997.     [ helpstring("GetDeviceCaps: Number of device-specific fonts") ]
  1998.     const int NUMFONTS      = 22;
  1999.     [ helpstring("GetDeviceCaps: Entries in device color table") ]
  2000.     const int NUMCOLORS     = 24;
  2001.     [ helpstring("GetDeviceCaps: Size of PDEVICE structure in bytes") ]
  2002.     const int PDEVICESIZE   = 26;
  2003.     [ helpstring("GetDeviceCaps: Curve capability flags - CC_NONE, CC_CIRCLES, CC_PIE, CC_CHORD, CC_ELLIPSES, CC_WIDE, CC_STYLED, CC_WIDESTYLED, CC_INTERIORS, CC_ROUNDRECT") ]
  2004.     const int CURVECAPS     = 28;
  2005.     [ helpstring("GetDeviceCaps: Line capability flags - LC_NONE, LC_POLYLINE, LC_MARKER, LC_POLYMARKER, LC_WIDE, LC_STYLED, LC_WIDESTYLED, LC_INTERIORS") ]
  2006.     const int LINECAPS      = 30;
  2007.     [ helpstring("GetDeviceCaps: Polygon capability flags - PC_NONE, PC_POLYGON, PC_RECTANGLE, PC_WINDPOLYGON, PC_SCANLINE, PC_WIDE, PC_STYLED, PC_WIDESTYLED, PC_INTERIORS") ]
  2008.     const int POLYGONALCAPS = 32;
  2009.     [ helpstring(
  2010.     "GetDeviceCaps: Text capability flags - TC_OP_STROKE, TC_CR_90, TC_CR_ANY, TC_IA_ABLE, TC_UA_ABLE, TC_SO_ABLE, TC_RA_ABLE, TC_VA_ABLE, Etc.") ]
  2011.     const int TEXTCAPS    = 34;
  2012.     [ helpstring("GetDeviceCaps: Clipping capability flags - CP_NONE, CP_RECTANGLE, CP_REGION") ]
  2013.     const int CLIPCAPS      = 36;
  2014.     [ helpstring(
  2015.     "GetDeviceCaps: Raster capability flags - RC_BITBLT, RC_SCALING, RC_SAVEBITMAP, RC_DI_BITMAP, RC_PALETTE, RC_STRETCHBLT, RC_FLOODFILL, RC_STRETCHDIB, Etc."
  2016.     ) ]
  2017.     const int RASTERCAPS    = 38;
  2018.     [ helpstring("GetDeviceCaps: X Aspect") ]
  2019.     const int ASPECTX       = 40;
  2020.     [ helpstring("GetDeviceCaps: Y Aspect") ]
  2021.     const int ASPECTY       = 42;
  2022.     [ helpstring("GetDeviceCaps: X/Y Aspect") ]
  2023.     const int ASPECTXY      = 44;
  2024.     [ helpstring("GetDeviceCaps: X pixels per logical inch") ]
  2025.     const int LOGPIXELSX    = 88;
  2026.     [ helpstring("GetDeviceCaps: Y pixels per logical inch") ]
  2027.     const int LOGPIXELSY    = 90;
  2028.     [ helpstring("GetDeviceCaps: Entries in system palette") ]
  2029.     const int SIZEPALETTE   = 104;
  2030.     [ helpstring("GetDeviceCaps: Reserved entries in system palette") ]
  2031.     const int NUMRESERVED   = 106;
  2032.     [ helpstring("GetDeviceCaps: Color resolution in bits per pixel") ]
  2033.     const int COLORRES      = 108;
  2034.  
  2035.     // GetDeviceCaps() return value masks
  2036.  
  2037.     // Printing related DeviceCaps. These replace the appropriate Escapes
  2038.  
  2039.     const int PHYSICALWIDTH   = 110; // Physical Width in device units
  2040.     const int PHYSICALHEIGHT  = 111; // Physical Height in device units
  2041.     const int PHYSICALOFFSETX = 112; // Physical Printable Area x margin
  2042.     const int PHYSICALOFFSETY = 113; // Physical Printable Area y margin
  2043.     const int SCALINGFACTORX  = 114; // Scaling factor x
  2044.     const int SCALINGFACTORY  = 115; // Scaling factor y
  2045.  
  2046.     // Display driver specific
  2047.  
  2048.     const int VREFRESH        = 116; // Current vertical refresh rate of the
  2049.                                      // display device (for displays only) in Hz
  2050.     const int DESKTOPVERTRES  = 117; // Horizontal width of entire desktop in
  2051.                                      // pixels
  2052.     const int DESKTOPHORZRES  = 118; // Vertical height of entire desktop in
  2053.                                      // pixels
  2054.     const int BLTALIGNMENT    = 119; // Preferred blt alignment
  2055.  
  2056.     // TECHNOLOGY
  2057.     [ helpstring("GetDeviceCaps: TECHNOLOGY flag") ]
  2058.     const int DT_PLOTTER        = 0;
  2059.     [ helpstring("GetDeviceCaps: TECHNOLOGY flag") ]
  2060.     const int DT_RASDISPLAY     = 1;
  2061.     [ helpstring("GetDeviceCaps: TECHNOLOGY flag") ]
  2062.     const int DT_RASPRINTER     = 2;
  2063.     [ helpstring("GetDeviceCaps: TECHNOLOGY flag") ]
  2064.     const int DT_RASCAMERA      = 3;
  2065.     [ helpstring("GetDeviceCaps: TECHNOLOGY flag") ]
  2066.     const int DT_CHARSTREAM     = 4;
  2067.     [ helpstring("GetDeviceCaps: TECHNOLOGY flag") ]
  2068.     const int DT_METAFILE       = 5;
  2069.     [ helpstring("GetDeviceCaps: TECHNOLOGY flag") ]
  2070.     const int DT_DISPFILE       = 6;
  2071.  
  2072.     // Curve Capabilities 
  2073.     [ helpstring("GetDeviceCaps: CURVECAPS flag") ]
  2074.     const UINT CC_NONE          = 0x0000;
  2075.     [ helpstring("GetDeviceCaps: CURVECAPS flag") ]
  2076.     const UINT CC_CIRCLES       = 0x0001;
  2077.     [ helpstring("GetDeviceCaps: CURVECAPS flag") ]
  2078.     const UINT CC_PIE           = 0x0002;
  2079.     [ helpstring("GetDeviceCaps: CURVECAPS flag") ]
  2080.     const UINT CC_CHORD         = 0x0004;
  2081.     [ helpstring("GetDeviceCaps: CURVECAPS flag") ]
  2082.     const UINT CC_ELLIPSES      = 0x0008;
  2083.     [ helpstring("GetDeviceCaps: CURVECAPS flag") ]
  2084.     const UINT CC_WIDE          = 0x0010;
  2085.     [ helpstring("GetDeviceCaps: CURVECAPS flag") ]
  2086.     const UINT CC_STYLED        = 0x0020;
  2087.     [ helpstring("GetDeviceCaps: CURVECAPS flag") ]
  2088.     const UINT CC_WIDESTYLED    = 0x0040;
  2089.     [ helpstring("GetDeviceCaps: CURVECAPS flag") ]
  2090.     const UINT CC_INTERIORS     = 0x0080;
  2091.     [ helpstring("GetDeviceCaps: CURVECAPS flag") ]
  2092.     const UINT CC_ROUNDRECT     = 0x0100;
  2093.  
  2094.     // Line Capabilities 
  2095.     [ helpstring("GetDeviceCaps: LINECAPS flag") ]
  2096.     const UINT LC_NONE          = 0x0000;
  2097.     [ helpstring("GetDeviceCaps: LINECAPS flag") ]
  2098.     const UINT LC_POLYLINE      = 0x0002;
  2099.     [ helpstring("GetDeviceCaps: LINECAPS flag") ]
  2100.     const UINT LC_MARKER            = 0x0004;
  2101.     [ helpstring("GetDeviceCaps: LINECAPS flag") ]
  2102.     const UINT LC_POLYMARKER        = 0x0008;
  2103.     [ helpstring("GetDeviceCaps: LINECAPS flag") ]
  2104.     const UINT LC_WIDE          = 0x0010;
  2105.     [ helpstring("GetDeviceCaps: LINECAPS flag") ]
  2106.     const UINT LC_STYLED            = 0x0020;
  2107.     [ helpstring("GetDeviceCaps: LINECAPS flag") ]
  2108.     const UINT LC_WIDESTYLED        = 0x0040;
  2109.     [ helpstring("GetDeviceCaps: LINECAPS flag") ]
  2110.     const UINT LC_INTERIORS     = 0x0080;
  2111.  
  2112.     // Polygonal Capabilities 
  2113.     [ helpstring("GetDeviceCaps: POLYCONALCAPS flag") ]
  2114.     const UINT PC_NONE          = 0x0000;
  2115.     [ helpstring("GetDeviceCaps: POLYCONALCAPS flag") ]
  2116.     const UINT PC_POLYGON       = 0x0001;
  2117.     [ helpstring("GetDeviceCaps: POLYCONALCAPS flag") ]
  2118.     const UINT PC_RECTANGLE     = 0x0002;
  2119.     [ helpstring("GetDeviceCaps: POLYCONALCAPS flag") ]
  2120.     const UINT PC_WINDPOLYGON   = 0x0004;
  2121.     [ helpstring("GetDeviceCaps: POLYCONALCAPS flag") ]
  2122.     const UINT PC_SCANLINE      = 0x0008;
  2123.     [ helpstring("GetDeviceCaps: POLYCONALCAPS flag") ]
  2124.     const UINT PC_WIDE          = 0x0010;
  2125.     [ helpstring("GetDeviceCaps: POLYCONALCAPS flag") ]
  2126.     const UINT PC_STYLED        = 0x0020;
  2127.     [ helpstring("GetDeviceCaps: POLYCONALCAPS flag") ]
  2128.     const UINT PC_WIDESTYLED    = 0x0040;
  2129.     [ helpstring("GetDeviceCaps: POLYCONALCAPS flag") ]
  2130.     const UINT PC_INTERIORS     = 0x0080;
  2131.     const int PC_POLYPOLYGON    = 256; // Can do polypolygons
  2132.     const int PC_PATHS          = 512; // Can do paths
  2133.  
  2134.     // CLIPCAPS
  2135.     [ helpstring("GetDeviceCaps: CLIPCAPS flag") ]
  2136.     const UINT CP_NONE          = 0x0000;
  2137.     [ helpstring("GetDeviceCaps: CLIPCAPS flag") ]
  2138.     const UINT CP_RECTANGLE     = 0x0001;
  2139.     [ helpstring("GetDeviceCaps: CLIPCAPS flag") ]
  2140.     const UINT CP_REGION        = 0x0002;
  2141.  
  2142.     // TEXTCAPS
  2143.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2144.     const UINT TC_OP_CHARACTER  = 0x0001;
  2145.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2146.     const UINT TC_OP_STROKE     = 0x0002;
  2147.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2148.     const UINT TC_CP_STROKE     = 0x0004;
  2149.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2150.     const UINT TC_CR_90         = 0x0008;
  2151.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2152.     const UINT TC_CR_ANY        = 0x0010;
  2153.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2154.     const UINT TC_SF_X_YINDEP   = 0x0020;
  2155.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2156.     const UINT TC_SA_DOUBLE     = 0x0040;
  2157.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2158.     const UINT TC_SA_INTEGER    = 0x0080;
  2159.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2160.     const UINT TC_SA_CONTIN     = 0x0100;
  2161.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2162.     const UINT TC_EA_DOUBLE     = 0x0200;
  2163.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2164.     const UINT TC_IA_ABLE       = 0x0400;
  2165.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2166.     const UINT TC_UA_ABLE       = 0x0800;
  2167.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2168.     const UINT TC_SO_ABLE       = 0x1000;
  2169.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2170.     const UINT TC_RA_ABLE       = 0x2000;
  2171.     [ helpstring("GetDeviceCaps: TEXTCAPS flag") ]
  2172.     const UINT TC_VA_ABLE       = 0x4000;
  2173.     const UINT TC_RESERVED      = 0x00008000;
  2174.     const UINT TC_SCROLLBLT     = 0x00010000;  // Don't do text scroll with blt
  2175.  
  2176.  
  2177.     // RASTERCAPS
  2178.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2179.     const UINT RC_BITBLT        = 0x0001;
  2180.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2181.     const UINT RC_BANDING       = 0x0002;
  2182.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2183.     const UINT RC_SCALING       = 0x0004;
  2184.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2185.     const UINT RC_BITMAP64      = 0x0008;
  2186.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2187.     const UINT RC_GDI20_OUTPUT  = 0x0010;
  2188.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2189.     const UINT RC_GDI20_STATE   = 0x0020;
  2190.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2191.     const UINT RC_SAVEBITMAP    = 0x0040;
  2192.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2193.     const UINT RC_DI_BITMAP     = 0x0080;
  2194.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2195.     const UINT RC_PALETTE       = 0x0100;
  2196.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2197.     const UINT RC_DIBTODEV      = 0x0200;
  2198.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2199.     const UINT RC_BIGFONT       = 0x0400;
  2200.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2201.     const UINT RC_STRETCHBLT    = 0x0800;
  2202.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2203.     const UINT RC_FLOODFILL     = 0x1000;
  2204.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2205.     const UINT RC_STRETCHDIB    = 0x2000;
  2206.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2207.     const UINT RC_OP_DX_OUTPUT  = 0x4000;
  2208.     [ helpstring("GetDeviceCaps: RASTERCAPS flag") ]
  2209.     const UINT RC_DEVBITS        = 0x8000;
  2210.  
  2211.     [ helpstring("GetDeviceCaps: Other capability flags - C1_TRANSPARENT") ]
  2212.     const int CAPS1         = 94;
  2213.     [ helpstring("GetDeviceCaps: CAPS1 transparency flag") ]
  2214.     const UINT C1_TRANSPARENT   = 0x0001;   // new raster cap
  2215.  
  2216.  
  2217.     // DIB color table identifiers 
  2218.  
  2219.     const int DIB_RGB_COLORS    = 0; // color table in RGBs
  2220.     const int DIB_PAL_COLORS    = 1; // color table in palette indices
  2221.  
  2222.     // constants for Get/SetSystemPaletteUse() 
  2223.  
  2224.     const int SYSPAL_ERROR      = 0;
  2225.     const int SYSPAL_STATIC     = 1;
  2226.     const int SYSPAL_NOSTATIC   = 2;
  2227.  
  2228.     // constants for CreateDIBitmap 
  2229.     const UINT CBM_INIT        = 0x04L;   // initialize bitmap
  2230.  
  2231.     // ExtFloodFill style flags
  2232.     [ helpstring("ExtFloodFill: Fill to border specified by color") ]
  2233.     const int FLOODFILLBORDER   = 0;
  2234.     [ helpstring("ExtFloodFill: Fill with color, end of color is border") ]
  2235.     const int FLOODFILLSURFACE  = 1;
  2236.  
  2237.     // size of a device name string 
  2238.     const int CCHDEVICENAME = 32;
  2239.  
  2240.     // size of a form name string 
  2241.     const int CCHFORMNAME = 32;
  2242.  
  2243.     // current version of specification 
  2244.     const UINT DM_SPECVERSION = 0x0400;
  2245.  
  2246.     // field selection bits 
  2247.     const UINT DM_ORIENTATION      = 0x00000001L;
  2248.     const UINT DM_PAPERSIZE        = 0x00000002L;
  2249.     const UINT DM_PAPERLENGTH      = 0x00000004L;
  2250.     const UINT DM_PAPERWIDTH       = 0x00000008L;
  2251.     const UINT DM_SCALE            = 0x00000010L;
  2252.     const UINT DM_COPIES           = 0x00000100L;
  2253.     const UINT DM_DEFAULTSOURCE    = 0x00000200L;
  2254.     const UINT DM_PRINTQUALITY     = 0x00000400L;
  2255.     const UINT DM_COLOR            = 0x00000800L;
  2256.     const UINT DM_DUPLEX           = 0x00001000L;
  2257.     const UINT DM_YRESOLUTION      = 0x00002000L;
  2258.     const UINT DM_TTOPTION         = 0x00004000L;
  2259.     const UINT DM_COLLATE          = 0x00008000L;
  2260.     const UINT DM_FORMNAME         = 0x00010000L;
  2261.     const UINT DM_LOGPIXELS        = 0x00020000L;
  2262.     const UINT DM_BITSPERPEL       = 0x00040000L;
  2263.     const UINT DM_PELSWIDTH        = 0x00080000L;
  2264.     const UINT DM_PELSHEIGHT       = 0x00100000L;
  2265.     const UINT DM_DISPLAYFLAGS     = 0x00200000L;
  2266.     const UINT DM_DISPLAYFREQUENCY = 0x00400000L;
  2267.     const UINT DM_ICMMETHOD        = 0x00800000L;
  2268.     const UINT DM_ICMINTENT        = 0x01000000L;
  2269.     const UINT DM_MEDIATYPE        = 0x02000000L;
  2270.     const UINT DM_DITHERTYPE       = 0x04000000L;
  2271.  
  2272.     // orientation selections 
  2273.     const int DMORIENT_PORTRAIT     = 1;
  2274.     const int DMORIENT_LANDSCAPE    = 2;
  2275.  
  2276.     // paper selections 
  2277.     const int DMPAPER_FIRST                = 1;  // DMPAPER_LETTER
  2278.     const int DMPAPER_LETTER               = 1;  // Letter 8 1/2 x 11 in
  2279.     const int DMPAPER_LETTERSMALL          = 2;  // Letter Small 8 1/2 x 11 in
  2280.     const int DMPAPER_TABLOID              = 3;  // Tabloid 11 x 17 in
  2281.     const int DMPAPER_LEDGER               = 4;  // Ledger 17 x 11 in
  2282.     const int DMPAPER_LEGAL                = 5;  // Legal 8 1/2 x 14 in
  2283.     const int DMPAPER_STATEMENT            = 6;  // Statement 5 1/2 x 8 1/2 in
  2284.     const int DMPAPER_EXECUTIVE            = 7;  // Executive 7 1/4 x 10 1/2 in
  2285.     const int DMPAPER_A3                   = 8;  // A3 297 x 420 mm
  2286.     const int DMPAPER_A4                   = 9;  // A4 210 x 297 mm
  2287.     const int DMPAPER_A4SMALL             = 10;  // A4 Small 210 x 297 mm
  2288.     const int DMPAPER_A5                  = 11;  // A5 148 x 210 mm
  2289.     const int DMPAPER_B4                  = 12;  // B4 (JIS) 250 x 354
  2290.     const int DMPAPER_B5                  = 13;  // B5 (JIS) 182 x 257 mm
  2291.     const int DMPAPER_FOLIO               = 14;  // Folio 8 1/2 x 13 in
  2292.     const int DMPAPER_QUARTO              = 15;  // Quarto 215 x 275 mm
  2293.     const int DMPAPER_10X14               = 16;  // 10x14 in
  2294.     const int DMPAPER_11X17               = 17;  // 11x17 in
  2295.     const int DMPAPER_NOTE                = 18;  // Note 8 1/2 x 11 in
  2296.     const int DMPAPER_ENV_9               = 19;  // Envelope #9 3 7/8 x 8 7/8
  2297.     const int DMPAPER_ENV_10              = 20;  // Envelope #10 4 1/8 x 9 1/2
  2298.     const int DMPAPER_ENV_11              = 21;  // Envelope #11 4 1/2 x 10 3/8
  2299.     const int DMPAPER_ENV_12              = 22;  // Envelope #12 4 \276 x 11
  2300.     const int DMPAPER_ENV_14              = 23;  // Envelope #14 5 x 11 1/2
  2301.     const int DMPAPER_CSHEET              = 24;  // C size sheet
  2302.     const int DMPAPER_DSHEET              = 25;  // D size sheet
  2303.     const int DMPAPER_ESHEET              = 26;  // E size sheet
  2304.     const int DMPAPER_ENV_DL              = 27;  // Envelope DL 110 x 220mm
  2305.     const int DMPAPER_ENV_C5              = 28;  // Envelope C5 162 x 229 mm
  2306.     const int DMPAPER_ENV_C3              = 29;  // Envelope C3  324 x 458 mm
  2307.     const int DMPAPER_ENV_C4              = 30;  // Envelope C4  229 x 324 mm
  2308.     const int DMPAPER_ENV_C6              = 31;  // Envelope C6  114 x 162 mm
  2309.     const int DMPAPER_ENV_C65             = 32;  // Envelope C65 114 x 229 mm
  2310.     const int DMPAPER_ENV_B4              = 33;  // Envelope B4  250 x 353 mm
  2311.     const int DMPAPER_ENV_B5              = 34;  // Envelope B5  176 x 250 mm
  2312.     const int DMPAPER_ENV_B6              = 35;  // Envelope B6  176 x 125 mm
  2313.     const int DMPAPER_ENV_ITALY           = 36;  // Envelope 110 x 230 mm
  2314.     const int DMPAPER_ENV_MONARCH         = 37;  // Envelope Monarch 3.875 x 7.5 in
  2315.     const int DMPAPER_ENV_PERSONAL        = 38;  // 6 3/4 Envelope 3 5/8 x 6 1/2 in
  2316.     const int DMPAPER_FANFOLD_US          = 39;  // US Std Fanfold 14 7/8 x 11 in
  2317.     const int DMPAPER_FANFOLD_STD_GERMAN  = 40;  // German Std Fanfold 8 1/2 x 12 in
  2318.     const int DMPAPER_FANFOLD_LGL_GERMAN  = 41;  // German Legal Fanfold 8 1/2 x 13 in
  2319.     const int DMPAPER_ISO_B4              = 42;  // B4 (ISO) 250 x 353 mm
  2320.     const int DMPAPER_JAPANESE_POSTCARD   = 43;  // Japanese Postcard 100 x 148 mm
  2321.     const int DMPAPER_9X11                = 44;  // 9 x 11 in
  2322.     const int DMPAPER_10X11               = 45;  // 10 x 11 in
  2323.     const int DMPAPER_15X11               = 46;  // 15 x 11 in
  2324.     const int DMPAPER_ENV_INVITE          = 47;  // Envelope Invite 220 x 220 mm
  2325.     const int DMPAPER_RESERVED_48         = 48;  // RESERVED--DO NOT USE
  2326.     const int DMPAPER_RESERVED_49         = 49;  // RESERVED--DO NOT USE
  2327.     const int DMPAPER_LETTER_EXTRA        = 50;  // Letter Extra 9 \275 x 12 in
  2328.     const int DMPAPER_LEGAL_EXTRA         = 51;  // Legal Extra 9 \275 x 15 in
  2329.     const int DMPAPER_TABLOID_EXTRA       = 52;  // Tabloid Extra 11.69 x 18 in
  2330.     const int DMPAPER_A4_EXTRA            = 53;  // A4 Extra 9.27 x 12.69 in
  2331.     const int DMPAPER_LETTER_TRANSVERSE   = 54;  // Letter Transverse 8 \275 x 11 in
  2332.     const int DMPAPER_A4_TRANSVERSE       = 55;  // A4 Transverse 210 x 297 mm
  2333.     const int DMPAPER_LETTER_EXTRA_TRANSVERSE = 56; // Letter Extra Transverse 9\275 x 12 in
  2334.     const int DMPAPER_A_PLUS              = 57;  // SuperA/SuperA/A4 227 x 356 mm
  2335.     const int DMPAPER_B_PLUS              = 58;  // SuperB/SuperB/A3 305 x 487 mm
  2336.     const int DMPAPER_LETTER_PLUS         = 59;  // Letter Plus 8.5 x 12.69 in
  2337.     const int DMPAPER_A4_PLUS             = 60;  // A4 Plus 210 x 330 mm
  2338.     const int DMPAPER_A5_TRANSVERSE       = 61;  // A5 Transverse 148 x 210 mm
  2339.     const int DMPAPER_B5_TRANSVERSE       = 62;  // B5 (JIS) Transverse 182 x 257 mm
  2340.     const int DMPAPER_A3_EXTRA            = 63;  // A3 Extra 322 x 445 mm
  2341.     const int DMPAPER_A5_EXTRA            = 64;  // A5 Extra 174 x 235 mm
  2342.     const int DMPAPER_B5_EXTRA            = 65;  // B5 (ISO) Extra 201 x 276 mm
  2343.     const int DMPAPER_A2                  = 66;  // A2 420 x 594 mm
  2344.     const int DMPAPER_A3_TRANSVERSE       = 67;  // A3 Transverse 297 x 420 mm
  2345.     const int DMPAPER_A3_EXTRA_TRANSVERSE = 68;  // A3 Extra Transverse 322 x 445 mm
  2346.  
  2347.     const int DMPAPER_USER                = 256;
  2348.  
  2349.     // bin selections 
  2350.     const int DMBIN_FIRST         = 1; // DMBIN_UPPER
  2351.     const int DMBIN_UPPER         = 1;
  2352.     const int DMBIN_ONLYONE       = 1;
  2353.     const int DMBIN_LOWER         = 2;
  2354.     const int DMBIN_MIDDLE        = 3;
  2355.     const int DMBIN_MANUAL        = 4;
  2356.     const int DMBIN_ENVELOPE      = 5;
  2357.     const int DMBIN_ENVMANUAL     = 6;
  2358.     const int DMBIN_AUTO          = 7;
  2359.     const int DMBIN_TRACTOR       = 8;
  2360.     const int DMBIN_SMALLFMT      = 9;
  2361.     const int DMBIN_LARGEFMT      = 10;
  2362.     const int DMBIN_LARGECAPACITY = 11;
  2363.     const int DMBIN_CASSETTE      = 14;
  2364.     const int DMBIN_FORMSOURCE    = 15;
  2365.     const int DMBIN_LAST          = 15; // DMBIN_FORMSOURCE
  2366.  
  2367.     const int DMBIN_USER          = 256;   // device specific bins start here
  2368.  
  2369.     // print qualities
  2370.     const int DMRES_DRAFT         = -1;
  2371.     const int DMRES_LOW           = -2;
  2372.     const int DMRES_MEDIUM        = -3;
  2373.     const int DMRES_HIGH          = -4;
  2374.  
  2375.     // color enable/disable for color printers 
  2376.     const int DMCOLOR_MONOCHROME  = 1;
  2377.     const int DMCOLOR_COLOR       = 2;
  2378.  
  2379.     // duplex enable
  2380.     const int DMDUP_SIMPLEX    = 1;
  2381.     const int DMDUP_VERTICAL   = 2;
  2382.     const int DMDUP_HORIZONTAL = 3;
  2383.  
  2384.     // TrueType options 
  2385.     const int DMTT_BITMAP     = 1;       // print TT fonts as graphics
  2386.     const int DMTT_DOWNLOAD   = 2;       // download TT fonts as soft fonts
  2387.     const int DMTT_SUBDEV     = 3;       // substitute device fonts for TT fonts
  2388.     const int DMTT_DOWNLOAD_OUTLINE = 4; // download TT fonts as outline soft fonts
  2389.  
  2390.     // Collation selections 
  2391.     const int DMCOLLATE_FALSE  = 0;
  2392.     const int DMCOLLATE_TRUE   = 1;
  2393.  
  2394.     // DEVMODE dmDisplayFlags flags 
  2395.  
  2396.     const UINT DM_GRAYSCALE  = 0x00000001;
  2397.     const UINT DM_INTERLACED = 0x00000002;
  2398.  
  2399.     // ICM methods 
  2400.     const int DMICMMETHOD_NONE    = 1;   // ICM disabled
  2401.     const int DMICMMETHOD_SYSTEM  = 2;   // ICM handled by system
  2402.     const int DMICMMETHOD_DRIVER  = 3;   // ICM handled by driver
  2403.     const int DMICMMETHOD_DEVICE  = 4;   // ICM handled by device
  2404.  
  2405.     const int DMICMMETHOD_USER  = 256;   // Device-specific methods start here
  2406.  
  2407.     // ICM Intents 
  2408.     const int DMICM_SATURATE      = 1;   // Maximize color saturation
  2409.     const int DMICM_CONTRAST      = 2;   // Maximize color contrast
  2410.     const int DMICM_COLORMETRIC   = 3;   // Use specific color metric
  2411.  
  2412.     const int DMICM_USER        = 256;   // Device-specific intents start here
  2413.  
  2414.     // Media types 
  2415.  
  2416.     const int DMMEDIA_STANDARD      = 1;   // Standard paper
  2417.     const int DMMEDIA_TRANSPARENCY  = 2;   // Transparency
  2418.     const int DMMEDIA_GLOSSY        = 3;   // Glossy paper
  2419.  
  2420.     const int DMMEDIA_USER        = 256;   // Device-specific media start here
  2421.  
  2422.     // Dither types 
  2423.     const int DMDITHER_NONE         = 1;   // No dithering
  2424.     const int DMDITHER_COARSE       = 2;   // Dither with a coarse brush
  2425.     const int DMDITHER_FINE         = 3;   // Dither with a fine brush
  2426.     const int DMDITHER_LINEART      = 4;   // LineArt dithering
  2427.  
  2428.     const int DMDITHER_ERRORDIFFUSION = 5; // LineArt dithering
  2429.     const int DMDITHER_RESERVED6    = 6;   // LineArt dithering
  2430.     const int DMDITHER_RESERVED7    = 7;   // LineArt dithering
  2431.     const int DMDITHER_RESERVED8    = 8;   // LineArt dithering
  2432.     const int DMDITHER_RESERVED9    = 9;   // LineArt dithering
  2433.  
  2434.     const int DMDITHER_GRAYSCALE    = 10;   // Device does grayscaling
  2435.  
  2436.     const int DMDITHER_USER         = 256;   // Device-specific dithers start here
  2437.  
  2438.     // GetRegionData/ExtCreateRegion 
  2439.  
  2440.     const int RDH_RECTANGLES        = 1;
  2441.  
  2442.     //  GetGlyphOutline constants
  2443.  
  2444.     const int GGO_METRICS           = 0;
  2445.     const int GGO_BITMAP            = 1;
  2446.     const int GGO_NATIVE            = 2;
  2447.  
  2448.     const int  GGO_GRAY2_BITMAP     = 4;
  2449.     const int  GGO_GRAY4_BITMAP     = 5;
  2450.     const int  GGO_GRAY8_BITMAP     = 6;
  2451.     const int  GGO_GLYPH_INDEX      = 0x0080;
  2452.  
  2453.     const int TT_POLYGON_TYPE       = 24;
  2454.  
  2455.     const int TT_PRIM_LINE          = 1;
  2456.     const int TT_PRIM_QSPLINE       = 2;
  2457.  
  2458.     const UINT GCP_DBCS            = 0x0001;
  2459.     const UINT GCP_REORDER         = 0x0002;
  2460.     const UINT GCP_USEKERNING      = 0x0008;
  2461.     const UINT GCP_GLYPHSHAPE      = 0x0010;
  2462.     const UINT GCP_LIGATE          = 0x0020;
  2463.     //const UINT GCP_GLYPHINDEXING = 0x0080;
  2464.     const UINT GCP_DIACRITIC       = 0x0100;
  2465.     const UINT GCP_KASHIDA         = 0x0400;
  2466.     const UINT GCP_ERROR           = 0x8000;
  2467.     const UINT FLI_MASK            = 0x103B;
  2468.  
  2469.     const UINT GCP_JUSTIFY         = 0x00010000L;
  2470.     //const UINT GCP_NODIACRITICS  = 0x00020000L;
  2471.     const UINT FLI_GLYPHS          = 0x00040000L;
  2472.     const UINT GCP_CLASSIN         = 0x00080000L;
  2473.     const UINT GCP_MAXEXTENT       = 0x00100000L;
  2474.     const UINT GCP_JUSTIFYIN       = 0x00200000L;
  2475.     const UINT GCP_DISPLAYZWG      = 0x00400000L;
  2476.     const UINT GCP_SYMSWAPOFF      = 0x00800000L;
  2477.     const UINT GCP_NUMERICOVERRIDE = 0x01000000L;
  2478.     const UINT GCP_NEUTRALOVERRIDE = 0x02000000L;
  2479.     const UINT GCP_NUMERICSLATIN   = 0x04000000L;
  2480.     const UINT GCP_NUMERICSLOCAL   = 0x08000000L;
  2481.  
  2482.     const UINT GCPCLASS_LATIN                  = 1;
  2483.     const UINT GCPCLASS_HEBREW                 = 2;
  2484.     const UINT GCPCLASS_ARABIC                 = 2;
  2485.     const UINT GCPCLASS_NEUTRAL                = 3;
  2486.     const UINT GCPCLASS_LOCALNUMBER            = 4;
  2487.     const UINT GCPCLASS_LATINNUMBER            = 5;
  2488.     const UINT GCPCLASS_LATINNUMERICTERMINATOR = 6;
  2489.     const UINT GCPCLASS_LATINNUMERICSEPARATOR  = 7;
  2490.     const UINT GCPCLASS_NUMERICSEPARATOR       = 8;
  2491.     const UINT GCPCLASS_PREBOUNDLTR         = 0x80;
  2492.     const UINT GCPCLASS_PREBOUNDRTL         = 0x40;
  2493.     const UINT GCPCLASS_POSTBOUNDLTR        = 0x20;
  2494.     const UINT GCPCLASS_POSTBOUNDRTL        = 0x10;
  2495.  
  2496.     const UINT GCPGLYPH_LINKBEFORE          = 0x8000;
  2497.     const UINT GCPGLYPH_LINKAFTER           = 0x4000;
  2498.  
  2499.     // bits defined in wFlags of RASTERIZER_STATUS 
  2500.     const int TT_AVAILABLE    = 0x0001;
  2501.     const int TT_ENABLED      = 0x0002;
  2502.  
  2503.     // pixel types 
  2504.     const UINT PFD_TYPE_RGBA        = 0;
  2505.     const UINT PFD_TYPE_COLORINDEX  = 1;
  2506.  
  2507.     // layer types 
  2508.     const UINT PFD_MAIN_PLANE       = 0;
  2509.     const UINT PFD_OVERLAY_PLANE    = 1;
  2510.     const UINT PFD_UNDERLAY_PLANE   = -1;
  2511.  
  2512.     // PIXELFORMATDESCRIPTOR flags 
  2513.     const UINT PFD_DOUBLEBUFFER            = 0x00000001;
  2514.     const UINT PFD_STEREO                  = 0x00000002;
  2515.     const UINT PFD_DRAW_TO_WINDOW          = 0x00000004;
  2516.     const UINT PFD_DRAW_TO_BITMAP          = 0x00000008;
  2517.     const UINT PFD_SUPPORT_GDI             = 0x00000010;
  2518.     const UINT PFD_SUPPORT_OPENGL          = 0x00000020;
  2519.     const UINT PFD_GENERIC_FORMAT          = 0x00000040;
  2520.     const UINT PFD_NEED_PALETTE            = 0x00000080;
  2521.     const UINT PFD_NEED_SYSTEM_PALETTE     = 0x00000100;
  2522.     const UINT PFD_SWAP_EXCHANGE           = 0x00000200;
  2523.     const UINT PFD_SWAP_COPY               = 0x00000400;
  2524.  
  2525.     // PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only 
  2526.     const UINT PFD_DOUBLEBUFFER_DONTCARE   = 0x40000000;
  2527.     const UINT PFD_STEREO_DONTCARE         = 0x80000000;
  2528.  
  2529.     /*
  2530.     int WINAPI AddFontResource(LPCTSTR);
  2531.     */
  2532.  
  2533.     [
  2534.     usesgetlasterror,
  2535.     entry("AnimatePalette"),
  2536.     helpstring("Replaces entries in the specified logical palette"),
  2537.     ]
  2538.     BOOL WINAPI AnimatePalette(HPALETTE hpal, 
  2539.                                UINT iStartIndex, 
  2540.                                UINT cEntries, 
  2541.                                PALETTEENTRY * ppe);
  2542.  
  2543.     [
  2544.     usesgetlasterror,
  2545.     entry("Arc"),
  2546.     helpstring("Draws an elliptical arc"),
  2547.     ]
  2548.     BOOL WINAPI Arc(HDC hDC,
  2549.                     int nLeftRect, int nTopRect,
  2550.                     int nRightRect, int nBottomRect,
  2551.                     int nXRadial1, int nYRadial1,
  2552.                     int nXRadial2, int nYRadial2);
  2553.     
  2554.     [
  2555.     usesgetlasterror,
  2556.     entry("BitBlt"),
  2557.     helpstring("Combines source, destination, and pattern of two DCs according to ROP mode"),
  2558.     ]
  2559.     BOOL    WINAPI BitBlt(HDC hdcDest,
  2560.                           int nXDest, int nYDest,
  2561.                           int nWidth, int nHeight,
  2562.                           HDC hdcSrc,
  2563.                           int nXSrc, int nYSrc,
  2564.                           DWORD dwRop);
  2565.  
  2566.     [
  2567.     usesgetlasterror,
  2568.     entry("CancelDC"),
  2569.     helpstring("Cancels any pending operation on the specified device context"),
  2570.     ]
  2571.     BOOL  WINAPI CancelDC(HDC hdc);
  2572.  
  2573.     [
  2574.     usesgetlasterror,
  2575.     entry("Chord"),
  2576.     helpstring("Draws a chord (a region bounded by the intersection of an ellipse and a line segment, called a secant)"),
  2577.     ]
  2578.     BOOL WINAPI Chord(HDC hDC,
  2579.                       int nLeftRect, int nTopRect,
  2580.                       int nRightRect, int nBottomRect,
  2581.                       int nXRadial1, int nYRadial1,
  2582.                       int nXRadial2, int nYRadial2);
  2583.  
  2584.     /*
  2585.     int   WINAPI ChoosePixelFormat(HDC hdc, PIXELFORMATDESCRIPTOR *);
  2586.     */
  2587.  
  2588.     [
  2589.     usesgetlasterror,
  2590.     entry("CloseMetaFile"),
  2591.     helpstring("Closes metafile HDC and returns a metafile handle"),
  2592.     ]
  2593.     HMETAFILE WINAPI CloseMetaFile(HDC hdc);
  2594.  
  2595.     [
  2596.     usesgetlasterror,
  2597.     entry("CombineRgn"),
  2598.     helpstring("Combines two regions and stores the result in a third region"),
  2599.     ]
  2600.     int WINAPI CombineRgn(HRGN hrgnDst, HRGN hrgnSrc1, 
  2601.                           HRGN hrgnSrc2, int fnCombineMode);
  2602.  
  2603.     [
  2604.     usesgetlasterror,
  2605.     #ifdef UNICODE
  2606.     entry("CopyMetaFileW"),
  2607.     #else
  2608.     entry("CopyMetaFileA"),
  2609.     #endif
  2610.     helpstring("Copies source metafile to a file and returns handle of new metafile"),
  2611.     ]
  2612.     HMETAFILE WINAPI CopyMetaFile(HMETAFILE hmfSrc,
  2613.                                   LPCTSTR lpszFile);
  2614.  
  2615.     [
  2616.     usesgetlasterror,
  2617.     entry("CreateBitmap"),
  2618.     helpstring("Creates a device independent memory bitmap with the given width, height, and bit data"),
  2619.     ]
  2620.     HBITMAP WINAPI CreateBitmap(int nWidth, int nHeight,
  2621.                                 UINT cbPlanes, UINT cbBits,
  2622.                                 DWORD lpvBits);
  2623.  
  2624.     [
  2625.     usesgetlasterror,
  2626.     entry("CreateBitmapIndirect"),
  2627.     helpstring("Creates a bitmap with the specified width, height, and color format (color planes and bits per pixel)"),
  2628.     ]
  2629.     HBITMAP WINAPI CreateBitmapIndirect(BITMAP * lpbm);
  2630.  
  2631.     [
  2632.     usesgetlasterror,
  2633.     entry("CreateBrushIndirect"),
  2634.     helpstring("Creates a logical brush that has the specified style, color, and pattern"),
  2635.     ]
  2636.     HBRUSH  WINAPI CreateBrushIndirect(LOGBRUSH * lplb);
  2637.  
  2638.     [
  2639.     usesgetlasterror,
  2640.     entry("CreateCompatibleBitmap"),
  2641.     helpstring("Creates a bitmap of the given size compatible with the given DC"),
  2642.     ]
  2643.     HBITMAP WINAPI CreateCompatibleBitmap(HDC hdc,
  2644.                                           int nWidth,
  2645.                                           int nHeight);
  2646.  
  2647.     [
  2648.     usesgetlasterror,
  2649.     entry("CreateDiscardableBitmap"),
  2650.     helpstring("Creates a discardable bitmap that is compatible with the specified device"),
  2651.     ]
  2652.     HBITMAP WINAPI CreateDiscardableBitmap(HDC hdc, int nWidth, int nHeight);
  2653.  
  2654.     [
  2655.     usesgetlasterror,
  2656.     entry("CreateCompatibleDC"),
  2657.     helpstring("Creates a memory DC compatible with a given DC"),
  2658.     ]
  2659.     HDC WINAPI CreateCompatibleDC(HDC hdc);
  2660.  
  2661.     [
  2662.     usesgetlasterror,
  2663.     #ifdef UNICODE
  2664.     entry("CreateDCW"),
  2665.     #else
  2666.     entry("CreateDCA"),
  2667.     #endif
  2668.     helpstring("Creates a device context (DC) for a device by using the specified name"),
  2669.     ]
  2670.     HDC WINAPI CreateDC(LPCTSTR lpszDriver, LPCTSTR lpszDevice, 
  2671.                         LPCTSTR lpszOutput, DEVMODE * lpInitData);
  2672.  
  2673.     [
  2674.     usesgetlasterror,
  2675.     entry("CreateDIBitmap"),
  2676.     helpstring("Creates a device-dependent bitmap (DDB) from a device-independent bitmap (DIB) and, optionally, sets the bitmap bits"),
  2677.     ]
  2678.     HBITMAP WINAPI CreateDIBitmap(HDC hdc, 
  2679.                                   LPVOID lpbmih,
  2680.                                   DWORD fdwinit, 
  2681.                                   void * lpbInit, 
  2682.                                   LPVOID lpbmi,
  2683.                                   UINT fuUsage);
  2684.     
  2685.     [
  2686.     usesgetlasterror,
  2687.     entry("CreateDIBPatternBrush"),
  2688.     helpstring("Creates a logical brush that has the pattern specified by the device-independent bitmap (DIB)"),
  2689.     ]
  2690.     HBRUSH  WINAPI CreateDIBPatternBrush(HGLOBAL hglbDIBPacked, 
  2691.                                          UINT fuColorSpec);
  2692.     [
  2693.     usesgetlasterror,
  2694.     entry("CreateDIBPatternBrushPt"),
  2695.     helpstring("Creates a logical brush that has the pattern specified by the device-independent bitmap (DIB)"),
  2696.     ]
  2697.     HBRUSH  WINAPI CreateDIBPatternBrushPt(void * lpPackedDIB, 
  2698.                                            UINT iUsage);
  2699.     [
  2700.     usesgetlasterror,
  2701.     entry("CreateEllipticRgn"),
  2702.     helpstring("Creates an elliptical region"),
  2703.     ]
  2704.     HRGN    WINAPI CreateEllipticRgn(int nLeftRect, 
  2705.                                      int nTopRect, 
  2706.                                      int nRightRect, 
  2707.                                      int nBottomRect);
  2708.     [
  2709.     usesgetlasterror,
  2710.     entry("CreateEllipticRgnIndirect"),
  2711.     helpstring("Creates an elliptical region"),
  2712.     ]
  2713.     HRGN    WINAPI CreateEllipticRgnIndirect(RECT * lprc);
  2714.     
  2715.     [
  2716.     usesgetlasterror,
  2717.     #ifdef UNICODE
  2718.     entry("CreateFontIndirectW"),
  2719.     #else
  2720.     entry("CreateFontIndirectA"),
  2721.     #endif
  2722.     helpstring("Creates a logical font that has the characteristics specified in the specified structure"),
  2723.     ]
  2724.     HFONT WINAPI CreateFontIndirect(LOGFONT * lplf);
  2725.     
  2726.     [
  2727.     usesgetlasterror,
  2728.     #ifdef UNICODE
  2729.     entry("CreateFontW"),
  2730.     #else
  2731.     entry("CreateFontA"),
  2732.     #endif
  2733.     helpstring("Creates a logical font that has specific characteristics"),
  2734.     ]
  2735.     HFONT   WINAPI CreateFont(int nHeight, 
  2736.                               int nWidth, 
  2737.                               int nEscapement, 
  2738.                               int nOrientation, 
  2739.                               int fnWeight, 
  2740.                               DWORD fdwItalid,
  2741.                               DWORD fdwUnderline, 
  2742.                               DWORD fdwStrikeOut, 
  2743.                               DWORD fdwCharSet, 
  2744.                               DWORD fdwOutputPrecision, 
  2745.                               DWORD fdwClipPrecision, 
  2746.                               DWORD fdwQuality, 
  2747.                               DWORD fdwPitchAndFamily, 
  2748.                               LPCTSTR lpszFace);
  2749.  
  2750.     [
  2751.     usesgetlasterror,
  2752.     entry("CreateHatchBrush"),
  2753.     helpstring("Creates a logical brush that has the specified hatch pattern and color"),
  2754.     ]
  2755.     HBRUSH  WINAPI CreateHatchBrush(int fnStyle, COLORREF clrref);
  2756.     
  2757.     [
  2758.     usesgetlasterror,
  2759.     #ifdef UNICODE
  2760.     entry("CreateICW"),
  2761.     #else
  2762.     entry("CreateICA"),
  2763.     #endif
  2764.     helpstring("Creates an information context for the specified device"),
  2765.     ]
  2766.     HDC WINAPI CreateIC(LPCTSTR lpszDriver, LPCTSTR lpszDevice, 
  2767.                         LPCTSTR lpszOutput, DEVMODE * lpdvminit);
  2768.  
  2769.     [
  2770.     usesgetlasterror,
  2771.     #ifdef UNICODE
  2772.     entry("CreateMetaFileW"),
  2773.     #else
  2774.     entry("CreateMetaFileA"),
  2775.     #endif
  2776.     helpstring("Returns a metafile HDC for lpszFile (or for a memory metafile if NULL)"),
  2777.     ]
  2778.     HDC     WINAPI CreateMetaFile(LPCTSTR lpszFile);
  2779.  
  2780.     [
  2781.     usesgetlasterror,
  2782.     entry("CreatePalette"),
  2783.     helpstring("Creates a logical color palette"),
  2784.     ]
  2785.     HPALETTE WINAPI CreatePalette(LPLOGPALETTE256 lplgpl);
  2786.  
  2787.     [
  2788.     usesgetlasterror,
  2789.     entry("CreatePen"),
  2790.     helpstring("Creates a logical pen that has the specified style, width, and color"),
  2791.     ]
  2792.     HPEN WINAPI CreatePen(int fnPenStyle, int nWidth, COLORREF crColor);
  2793.  
  2794.     [
  2795.     usesgetlasterror,
  2796.     entry("CreatePenIndirect"),
  2797.     helpstring("Creates a logical cosmetic pen that has the style, width, and color specified in a structure"),
  2798.     ]
  2799.     HPEN    WINAPI CreatePenIndirect(LOGPEN * lplgpn);
  2800.  
  2801.     [
  2802.     usesgetlasterror,
  2803.     entry("CreatePolyPolygonRgn"),
  2804.     helpstring("Creates a region consisting of a series of polygons (possibly overlapping)"),
  2805.     ]
  2806.     HRGN    WINAPI CreatePolyPolygonRgn(POINTL * lppt,
  2807.                                         int * lpPolyCounts, 
  2808.                                         int nCount, 
  2809.                                         int fnPolyFillMode);
  2810.  
  2811.     [
  2812.     usesgetlasterror,
  2813.     entry("CreatePatternBrush"),
  2814.     helpstring("Creates a logical brush with the specified bitmap pattern"),
  2815.     ]
  2816.     HBRUSH  WINAPI CreatePatternBrush(HBITMAP hbmp);
  2817.  
  2818.     [
  2819.     usesgetlasterror,
  2820.     entry("CreateRectRgn"),
  2821.     helpstring("Creates a rectangular region"),
  2822.     ]
  2823.     HRGN    WINAPI CreateRectRgn(int nLeftRect, int nTopRect,
  2824.                                  int nRightRect, int nBottomRect);
  2825.  
  2826.     [
  2827.     usesgetlasterror,
  2828.     entry("CreateRectRgnIndirect"),
  2829.     helpstring("Creates a rectangular region"),
  2830.     ]
  2831.     HRGN    WINAPI CreateRectRgnIndirect(RECT * lprc);
  2832.  
  2833.     [
  2834.     usesgetlasterror,
  2835.     entry("CreateRoundRectRgn"),
  2836.     helpstring(""),
  2837.     ]
  2838.     HRGN    WINAPI CreateRoundRectRgn(int nLeftRect, int nTopRect,
  2839.                                       int nRightRect, int nBottomRect,
  2840.                                       int nWidthEllipse, 
  2841.                                       int nHeightEllipse);
  2842.  
  2843.     [
  2844.     usesgetlasterror,
  2845.     #ifdef UNICODE
  2846.     entry("CreateScalableFontResourceW"),
  2847.     #else
  2848.     entry("CreateScalableFontResourceA"),
  2849.     #endif
  2850.     helpstring("Creates a font resource file for a scalable font"),
  2851.     ]
  2852.     BOOL    WINAPI CreateScalableFontResource(DWORD fdwHidden, 
  2853.                                               LPCTSTR lpszFontRes, 
  2854.                                               LPCTSTR lpszFontFile, 
  2855.                                               LPCTSTR lpszCurrentPath);
  2856.  
  2857.     [
  2858.     usesgetlasterror,
  2859.     entry("CreateSolidBrush"),
  2860.     helpstring("Creates a logical brush that has the specified solid color"),
  2861.     ]
  2862.     HBRUSH  WINAPI CreateSolidBrush(COLORREF crColor);
  2863.  
  2864.     [
  2865.     usesgetlasterror,
  2866.     entry("DeleteDC"),
  2867.     helpstring("Deletes a given DC"),
  2868.     ]
  2869.     BOOL WINAPI DeleteDC(HDC hdc);
  2870.  
  2871.     [
  2872.     usesgetlasterror,
  2873.     entry("DeleteMetaFile"),
  2874.     helpstring("Invalidates the metafile handle"),
  2875.     ]
  2876.     BOOL      WINAPI DeleteMetaFile(HMETAFILE hmf);
  2877.  
  2878.     [
  2879.     usesgetlasterror,
  2880.     entry("DeleteObject"),
  2881.     helpstring("Deletes a given GDI object"),
  2882.     ]
  2883.     BOOL    WINAPI DeleteObject(HGDIOBJ hgdiobj);
  2884.  
  2885.     /*
  2886.     int  WINAPI DescribePixelFormat(HDC hdc, int, UINT, LPPIXELFORMATDESCRIPTOR);
  2887.     */
  2888.  
  2889.     // Define types of pointers to ExtDeviceMode() and DeviceCapabilities()
  2890.     // functions for Win 3.1 compatibility
  2891.  
  2892.  
  2893.     // Mode selections for the device mode function 
  2894.     const int DM_UPDATE           = 1;
  2895.     const int DM_COPY             = 2;
  2896.     const int DM_PROMPT           = 4;
  2897.     const int DM_MODIFY           = 8;
  2898.  
  2899.     const int DM_IN_BUFFER        = 8; // DM_MODIFY
  2900.     const int DM_IN_PROMPT        = 4; // DM_PROMPT
  2901.     const int DM_OUT_BUFFER       = 2; // DM_COPY
  2902.     const int DM_OUT_DEFAULT      = 1; // DM_UPDATE
  2903.  
  2904.     // device capabilities indices 
  2905.     const int DC_FIELDS           = 1;
  2906.     const int DC_PAPERS           = 2;
  2907.     const int DC_PAPERSIZE        = 3;
  2908.     const int DC_MINEXTENT        = 4;
  2909.     const int DC_MAXEXTENT        = 5;
  2910.     const int DC_BINS             = 6;
  2911.     const int DC_DUPLEX           = 7;
  2912.     const int DC_SIZE             = 8;
  2913.     const int DC_EXTRA            = 9;
  2914.     const int DC_VERSION          = 10;
  2915.     const int DC_DRIVER           = 11;
  2916.     const int DC_BINNAMES         = 12;
  2917.     const int DC_ENUMRESOLUTIONS  = 13;
  2918.     const int DC_FILEDEPENDENCIES = 14;
  2919.     const int DC_TRUETYPE         = 15;
  2920.     const int DC_PAPERNAMES       = 16;
  2921.     const int DC_ORIENTATION      = 17;
  2922.     const int DC_COPIES           = 18;
  2923.     const int DC_BINADJUST            = 19;
  2924.     const int DC_EMF_COMPLIANT        = 20;
  2925.     const int DC_DATATYPE_PRODUCED    = 21;
  2926.     const int DC_MANUFACTURER     = 23;
  2927.     const int DC_MODEL            = 24;
  2928.  
  2929.     // bit fields of the return value (DWORD) for DC_TRUETYPE 
  2930.     const UINT DCTT_BITMAP             = 0x0000001L;
  2931.     const UINT DCTT_DOWNLOAD           = 0x0000002L;
  2932.     const UINT DCTT_SUBDEV             = 0x0000004L;
  2933.     const UINT DCTT_DOWNLOAD_OUTLINE   = 0x0000008L;
  2934.  
  2935.     // return values for DC_BINADJUST 
  2936.     const UINT DCBA_FACEUPNONE         = 0x0000;
  2937.     const UINT DCBA_FACEUPCENTER       = 0x0001;
  2938.     const UINT DCBA_FACEUPLEFT         = 0x0002;
  2939.     const UINT DCBA_FACEUPRIGHT        = 0x0003;
  2940.     const UINT DCBA_FACEDOWNNONE       = 0x0100;
  2941.     const UINT DCBA_FACEDOWNCENTER     = 0x0101;
  2942.     const UINT DCBA_FACEDOWNLEFT       = 0x0102;
  2943.     const UINT DCBA_FACEDOWNRIGHT      = 0x0103;
  2944.  
  2945.     [
  2946.     usesgetlasterror,
  2947.     #ifdef UNICODE
  2948.     entry("DeviceCapabilitiesW"),
  2949.     #else
  2950.     entry("DeviceCapabilitiesA"),
  2951.     #endif
  2952.     helpstring("Retrieves the capabilities of a printer device driver"),
  2953.     ]
  2954.     int  WINAPI DeviceCapabilities(LPCTSTR pDevice, 
  2955.                                    LPCTSTR pPort, 
  2956.                                    WORD fwCapability, 
  2957.                                    LPTSTR pOutput, 
  2958.                                    DEVMODE * pDevMode);
  2959.  
  2960.     [
  2961.     usesgetlasterror,
  2962.     entry("DrawEscape"),
  2963.     helpstring("Accesses drawing capabilities of a video display that are not directly available through the graphics device interface (GDI)"),
  2964.     ]
  2965.     int  WINAPI DrawEscape(HDC hdc, int nEscape, 
  2966.                            int cbInput, LPCTSTR lpszInData);
  2967.  
  2968.     [
  2969.     usesgetlasterror,
  2970.     entry("Ellipse"),
  2971.     helpstring("Draws ellipse bounded by given points with current pen and filled with current brush"),
  2972.     ]
  2973.     BOOL    WINAPI Ellipse(HDC hdc,
  2974.                            int nLeft, int nTop,
  2975.                            int nRight, int nBottom);
  2976.  
  2977.     [
  2978.     usesgetlasterror,
  2979.     #ifdef UNICODE
  2980.     entry("EnumFontFamiliesExW"),
  2981.     #else
  2982.     entry("EnumFontFamiliesExA"),
  2983.     #endif
  2984.     helpstring("Enumerates all fonts in the system that match the font characteristics specified by the LOGFONT structure"),
  2985.     ]
  2986.     int  WINAPI EnumFontFamiliesEx(HDC hdc, 
  2987.                                    LOGFONT * lpLogFont,
  2988.                                    FONTENUMPROC lpEnumFontFamExProc, 
  2989.                                    LPARAM lParam,
  2990.                                    DWORD dwFlags);
  2991.     [
  2992.     usesgetlasterror,
  2993.     #ifdef UNICODE
  2994.     entry("EnumFontFamiliesW"),
  2995.     #else
  2996.     entry("EnumFontFamiliesA"),
  2997.     #endif
  2998.     helpstring("Enumerates the fonts in a specified font family that are available on a specified device"),
  2999.     ]
  3000.     int  WINAPI EnumFontFamilies(HDC hdc, 
  3001.                                  LPCTSTR lpszFamily, 
  3002.                                  FONTENUMPROC lpEnumFontFamProc, 
  3003.                                  LPARAM lParam);
  3004.  
  3005.     [
  3006.     usesgetlasterror,
  3007.     #ifdef UNICODE
  3008.     entry("EnumFontsW"),
  3009.     #else
  3010.     entry("EnumFontsA"),
  3011.     #endif
  3012.     helpstring("Enumerates the fonts available on a specified device"),
  3013.     ]
  3014.     int  WINAPI EnumFonts(HDC hdc, 
  3015.                           LPCTSTR lpFaceName,  
  3016.                           FONTENUMPROC lpFontFunc, 
  3017.                           LPARAM lParam);
  3018.  
  3019.     [
  3020.     usesgetlasterror,
  3021.     entry("EnumObjects"),
  3022.     helpstring("Enumerates the pens or brushes available for the specified device context"),
  3023.     ]
  3024.     int  WINAPI EnumObjects(HDC hdc, 
  3025.                             int nObjectType, 
  3026.                             GOBJENUMPROC lpObjectFunc,    
  3027.                             LPARAM lParam);
  3028.  
  3029.     [
  3030.     usesgetlasterror,
  3031.     entry("EqualRgn"),
  3032.     helpstring("Determines whether two specified regions are identical"),
  3033.     ]
  3034.     BOOL WINAPI EqualRgn(HRGN hSrcRgn1, HRGN hSrcRgn2);
  3035.  
  3036.     [
  3037.     usesgetlasterror,
  3038.     entry("Escape"),
  3039.     helpstring("Allows applications to access capabilities of a particular device not directly available through GDI"),
  3040.     ]
  3041.     int  WINAPI Escape(HDC hdc, 
  3042.                        int nEscape, 
  3043.                        int cbInput, 
  3044.                        LPCTSTR lpvInData, 
  3045.                        LPVOID lpvOutData);
  3046.  
  3047.     [
  3048.     usesgetlasterror,
  3049.     entry("ExtEscape"),
  3050.     helpstring("Allows applications to access capabilities of a particular device not directly available through GDI"),
  3051.     ]
  3052.     int  WINAPI ExtEscape(HDC hdc, 
  3053.                           int nEscape, 
  3054.                           int cbInput, 
  3055.                           LPCTSTR lpszInData, 
  3056.                           int cbOutput,
  3057.                           LPTSTR lpszOutData);
  3058.  
  3059.     [
  3060.     usesgetlasterror,
  3061.     entry("ExcludeClipRect"),
  3062.     helpstring("Creates a new clipping region that consists of the existing clipping region minus the specified rectangle"),
  3063.     ]
  3064.     int  WINAPI ExcludeClipRect(HDC hdc, 
  3065.                                 int nLeftRect, int nTopRect,
  3066.                                 int nRightRect, int nBottomRect);
  3067.  
  3068.     [
  3069.     usesgetlasterror,
  3070.     entry("ExtCreateRegion"),
  3071.     helpstring("Creates a region from the specified region and transformation data"),
  3072.     ]
  3073.     HRGN WINAPI ExtCreateRegion(XFORM * lpXform,
  3074.                                 DWORD nCount,
  3075.                                 RGNDATA * lpRgnData);
  3076.  
  3077.     [
  3078.     usesgetlasterror,
  3079.     entry("ExtFloodFill"),
  3080.     helpstring("Fill to nearest clrref border with current brush starting at x,y with given fill type"),
  3081.     ]
  3082.     BOOL    WINAPI ExtFloodFill(HDC hdc,
  3083.                                 int nXStart, int nYStart,
  3084.                                 COLORREF clrref,
  3085.                                 UINT fuFillType);
  3086.     
  3087.     [
  3088.     usesgetlasterror,
  3089.     entry("FillRgn"),
  3090.     helpstring("Fills a region by using the specified brush"),
  3091.     ]
  3092.     BOOL   WINAPI FillRgn(HDC hdc, HRGN hrgn, HBRUSH hbr);
  3093.  
  3094.     [
  3095.     usesgetlasterror,
  3096.     entry("FloodFill"),
  3097.     helpstring("Fill to the nearest clrref border with current brush starting at x,y"),
  3098.     ]
  3099.     BOOL    WINAPI FloodFill(HDC hdc,
  3100.                              int nXStart, int nYStart,
  3101.                              COLORREF clrref);
  3102.  
  3103.     [
  3104.     usesgetlasterror,
  3105.     entry("FrameRgn"),
  3106.     helpstring("Draws a border around the specified region by using the specified brush"),
  3107.     ]
  3108.     BOOL WINAPI FrameRgn(HDC hdc, 
  3109.                          HRGN hrgn, 
  3110.                          HBRUSH hbr, 
  3111.                          int nWidth, 
  3112.                          int nHeight);
  3113.  
  3114.     [
  3115.     usesgetlasterror,
  3116.     entry("GetROP2"),
  3117.     helpstring("Retrieves the foreground mix mode (which specifies how the pen or interior color and the color already on the screen are combined to yield a new color) of the specified device context"),
  3118.     ]
  3119.     int   WINAPI GetROP2(HDC hdc);
  3120.  
  3121.     [
  3122.     usesgetlasterror,
  3123.     entry("GetAspectRatioFilterEx"),
  3124.     helpstring("Retrieves the current aspect-ratio filter"),
  3125.     ]
  3126.     BOOL  WINAPI GetAspectRatioFilterEx(HDC hdc, 
  3127.                                         SIZE * lpAspectRatio);
  3128.  
  3129.     [
  3130.     usesgetlasterror,
  3131.     entry("GetBkColor"),
  3132.     helpstring("Get the background color of a DC"),
  3133.     ]
  3134.     COLORREF WINAPI GetBkColor(HDC hdc);
  3135.  
  3136.     [
  3137.     usesgetlasterror,
  3138.     entry("GetBkMode"),
  3139.     helpstring("Get the background mode of a DC"),
  3140.     ]
  3141.     int     WINAPI GetBkMode(HDC hdc);
  3142.  
  3143.  
  3144.     [
  3145.     usesgetlasterror,
  3146.     entry("GetBitmapBits"),
  3147.     helpstring("Fills buffer with bits from the specified bitmap"),
  3148.     ]
  3149.     LONG    WINAPI GetBitmapBits(HBITMAP hbm, 
  3150.                                  LONG cbBuffer, 
  3151.                                  BYTE * lpvBits);
  3152.  
  3153.     [
  3154.     usesgetlasterror,
  3155.     entry("GetBitmapDimensionEx"),
  3156.     helpstring("Retrieves the dimensions of a bitmap"),
  3157.     ]
  3158.     BOOL  WINAPI GetBitmapDimensionEx(HBITMAP hbm, 
  3159.                                       SIZE * lpDimension);
  3160.  
  3161.     [
  3162.     usesgetlasterror,
  3163.     entry("GetBoundsRect"),
  3164.     helpstring("Obtains the current accumulated bounding rectangle for a specified device context"),
  3165.     ]
  3166.     UINT  WINAPI GetBoundsRect(HDC hdc, 
  3167.                                RECT * lprc, 
  3168.                                UINT flags);
  3169.  
  3170.     [
  3171.     usesgetlasterror,
  3172.     entry("GetBrushOrgEx"),
  3173.     helpstring("Retrieves the current brush origin for the specified device context"),
  3174.     ]
  3175.     BOOL  WINAPI GetBrushOrgEx(HDC hdc, POINTL * lpPoint);
  3176.  
  3177.     [
  3178.     usesgetlasterror,
  3179.     #ifdef UNICODE
  3180.     entry("GetCharWidthW"),
  3181.     #else
  3182.     entry("GetCharWidthA"),
  3183.     #endif
  3184.     helpstring("Retrieves the widths, in logical coordinates, of consecutive characters in a specified range from the current font"),
  3185.     ]
  3186.     BOOL  WINAPI GetCharWidth(HDC hdc, 
  3187.                               UINT iFirstChar, 
  3188.                               UINT iLastChar, 
  3189.                               INT * lpBuffer);
  3190.  
  3191.     [
  3192.     usesgetlasterror,
  3193.     #ifdef UNICODE
  3194.     entry("GetCharWidth32W"),
  3195.     #else
  3196.     entry("GetCharWidth32A"),
  3197.     #endif
  3198.     helpstring("Retrieves the widths, in logical coordinates, of consecutive characters in a specified range from the current font"),
  3199.     ]
  3200.     BOOL  WINAPI GetCharWidth32(HDC hdc,
  3201.                                  UINT iFirstChar, 
  3202.                                 UINT iLastChar, 
  3203.                                 int * lpBuffer);
  3204.  
  3205. /*
  3206.     [
  3207.     usesgetlasterror,
  3208.     #ifdef UNICODE
  3209.     entry("GetCharWidthFloatW")
  3210.     #else
  3211.     entry("GetCharWidthFloatA"),
  3212.     #endif
  3213.     helpstring("Retrieves the fractional widths of consecutive characters in a specified range from the current font"),
  3214.     ]
  3215.     BOOL  WINAPI GetCharWidthFloat(HDC hdc, 
  3216.                                       UINT iFirstChar, 
  3217.                                      UINT iLastChar, 
  3218.                                      float * pxBuffer);
  3219.  
  3220.     [
  3221.     usesgetlasterror,
  3222.     #ifdef UNICODE
  3223.     entry("GetCharABCWidthsW"),
  3224.     #else
  3225.     entry("GetCharABCWidthsA"),
  3226.     #endif
  3227.     helpstring("Retrieves the widths, in logical units, of consecutive characters in a specified range from the current font"),
  3228.     ]
  3229.     BOOL  WINAPI GetCharABCWidths(HDC hdc, 
  3230.                                      UINT iFirstChar, 
  3231.                                     UINT iLastChar, 
  3232.                                     ABC * lpabc);
  3233.  
  3234.     [
  3235.     usesgetlasterror,
  3236.     #ifdef UNICODE
  3237.     entry("GetCharABCWidthsFloatW"),
  3238.     #else
  3239.     entry("GetCharABCWidthsFloatA"),
  3240.     #endif
  3241.     helpstring("Retrieves the widths, in logical units, of consecutive characters in a specified range from the current font"),
  3242.     ]
  3243.     BOOL WINAPI GetCharABCWidthsFloat(HDC hdc, UINT, UINT, 
  3244.                                          UINT iFirstChar, 
  3245.                                         UINT iLastChar, 
  3246.                                         ABCFLOAT * lpABCF);
  3247.  
  3248. */
  3249.  
  3250.     [
  3251.     usesgetlasterror,
  3252.     entry("GetClipBox"),
  3253.     helpstring("Retrieves the dimensions of the tightest bounding rectangle that can be drawn around the current visible area on the device"),
  3254.     ]
  3255.     int   WINAPI GetClipBox(HDC hdc, RECT * lprc);
  3256.  
  3257.     [
  3258.     usesgetlasterror,
  3259.     entry("GetClipRgn"),
  3260.     helpstring("Retrieves a handle identifying the current application-defined clipping region for the specified device context"),
  3261.     ]
  3262.     int   WINAPI GetClipRgn(HDC hdc, HRGN hrgn);
  3263.  
  3264.     [
  3265.     usesgetlasterror,
  3266.     entry("GetMetaRgn"),
  3267.     helpstring("Retrieves the current metaregion for the specified device context"),
  3268.     ]
  3269.     int   WINAPI GetMetaRgn(HDC hdc, HRGN hrgn);
  3270.  
  3271.     [
  3272.     usesgetlasterror,
  3273.     entry("GetCurrentObject"),
  3274.     helpstring("Returns the currently selected object of the specified type"),
  3275.     ]
  3276.     HGDIOBJ WINAPI GetCurrentObject(HDC hdc, UINT uObjectType);
  3277.  
  3278. //@B GetCurrentPositionEx
  3279.     [
  3280.     usesgetlasterror,
  3281.     entry("GetCurrentPositionEx"),
  3282.     helpstring("Get current position in a POINTL structure"),
  3283.     ]
  3284.     BOOL    WINAPI GetCurrentPositionEx(HDC hdc,
  3285.                                         int * lpPoint);
  3286. //@E GetCurrentPositionEx
  3287.  
  3288.     [
  3289.     usesgetlasterror,
  3290.     entry("GetDeviceCaps"),
  3291.     helpstring("Gets the capabilities of given DC"),
  3292.     ]
  3293.     int WINAPI GetDeviceCaps(HDC hdc, int iCapability);
  3294.  
  3295.     [
  3296.     usesgetlasterror,
  3297.     entry("GetDIBits"),
  3298.     helpstring("Retrieves the bits of the specified bitmap and copies them into a buffer using the specified format"),
  3299.     ]
  3300.     int   WINAPI GetDIBits(HDC hdc, 
  3301.                            HBITMAP hbm, 
  3302.                            UINT uStartScan, 
  3303.                            UINT cScanLines, 
  3304.                            LPVOID lpvBits,
  3305.                            LPVOID lpbi,
  3306.                            UINT uUsage);
  3307.  
  3308.     [
  3309.     usesgetlasterror,
  3310.     entry("GetFontData"),
  3311.     helpstring("Retrieves font metric data for a TrueType font"),
  3312.     ]
  3313.     DWORD WINAPI GetFontData(HDC hdc, 
  3314.                              DWORD dwTable, 
  3315.                              DWORD dwOffset, 
  3316.                              LPVOID lpvBuffer, 
  3317.                              DWORD cbData);
  3318.  
  3319.     [
  3320.     usesgetlasterror,
  3321.     #ifdef UNICODE
  3322.     entry("GetGlyphOutlineW"),
  3323.     #else
  3324.     entry("GetGlyphOutlineA"),
  3325.     #endif
  3326.     helpstring("Retrieves the outline or bitmap for a character in the TrueType font that is selected into the specified device context"),
  3327.     ]
  3328.     DWORD WINAPI GetGlyphOutline(HDC hdc, 
  3329.                                  UINT uChar, 
  3330.                                  UINT uFormat, 
  3331.                                  GLYPHMETRICS * lpgm, 
  3332.                                  DWORD cbBuffer, 
  3333.                                  LPVOID lpvBuffer, 
  3334.                                  MAT2 * lpmat2);
  3335.  
  3336.     [
  3337.     usesgetlasterror,
  3338.     entry("GetGraphicsMode"),
  3339.     helpstring("Retrieves the current graphics mode for the specified device context"),
  3340.     ]
  3341.     int WINAPI GetGraphicsMode(HDC hdc);
  3342.  
  3343.     [
  3344.     usesgetlasterror,
  3345.     entry("GetMapMode"),
  3346.     helpstring("Retrieves the current mapping mode"),
  3347.     ]
  3348.     int   WINAPI GetMapMode(HDC hdc);
  3349.  
  3350.     [
  3351.     usesgetlasterror,
  3352.     entry("GetMetaFileBitsEx"),
  3353.     helpstring("Returns global memory containing metafile as bits"),
  3354.     ]
  3355.     UINT  WINAPI GetMetaFileBitsEx(HMETAFILE hmf, UINT nSize,
  3356.                                    LPVOID lpvData);
  3357.  
  3358.     [
  3359.     usesgetlasterror,
  3360.     #ifdef UNICODE
  3361.     entry("GetMetaFileW"),
  3362.     #else
  3363.     entry("GetMetaFileA"),
  3364.     #endif
  3365.     helpstring("Creates handle for lpszFile metafile"),
  3366.     ]
  3367.     HMETAFILE WINAPI GetMetaFile(LPCTSTR lpszFile);
  3368.  
  3369.     [
  3370.     usesgetlasterror,
  3371.     entry("GetNearestColor"),
  3372.     helpstring("Returns color from system palette that will be displayed when the given color value is used"),
  3373.     ]
  3374.     COLORREF WINAPI GetNearestColor(HDC hdc, COLORREF clrref);
  3375.  
  3376.     [
  3377.     usesgetlasterror,
  3378.     entry("GetNearestPaletteIndex"),
  3379.     helpstring("Retrieves the index for the entry in the specified logical palette most closely matching a specified color value"),
  3380.     ]
  3381.     UINT  WINAPI GetNearestPaletteIndex(HPALETTE hpal, COLORREF clrref);
  3382.     
  3383.     /*
  3384.     [
  3385.     usesgetlasterror,
  3386.     entry("GetObjectType"),
  3387.     helpstring(""),
  3388.     ]
  3389.     DWORD WINAPI GetObjectType(HGDIOBJ hgdiobj h);
  3390.  
  3391.  
  3392.     [
  3393.     usesgetlasterror,
  3394.     #ifdef UNICODE
  3395.     entry("GetOutlineTextMetricsW"),
  3396.     #else
  3397.     entry("GetOutlineTextMetricsA"),
  3398.     #endif
  3399.     helpstring(""),
  3400.     ]
  3401.     UINT WINAPI GetOutlineTextMetrics(HDC hdc, UINT, LPOUTLINETEXTMETRICA);
  3402.  
  3403.     */
  3404.  
  3405.     [
  3406.     usesgetlasterror,
  3407.     entry("GetPaletteEntries"),
  3408.     helpstring("Retrieves specified range of palette entries from the given logical palette"),
  3409.     ]
  3410.     UINT  WINAPI GetPaletteEntries(HPALETTE hpal, 
  3411.                                    UINT iStartIndex, UINT nEntries, 
  3412.                                    LPPALETTEENTRY lppe);
  3413.  
  3414.     [
  3415.     usesgetlasterror,
  3416.     entry("GetPixel"),
  3417.     helpstring("Returns color of pixel at x,y"),
  3418.     ]
  3419.     COLORREF WINAPI GetPixel(HDC hdc,
  3420.                              int nXPos, int nYPos);
  3421.  
  3422.     /*
  3423.  
  3424.     [
  3425.     usesgetlasterror,
  3426.     entry("GetPixelFormat"),
  3427.     helpstring(""),
  3428.     ]
  3429.     int   WINAPI GetPixelFormat(HDC hdc);
  3430.     */
  3431.  
  3432.     [
  3433.     usesgetlasterror,
  3434.     entry("GetPolyFillMode"),
  3435.     helpstring("Gets polygon fill mode for functions that fill polygons"),
  3436.     ]
  3437.     int  WINAPI GetPolyFillMode(HDC hdc);
  3438.  
  3439.     /*
  3440.  
  3441.     [
  3442.     usesgetlasterror,
  3443.     entry("GetRasterizerCaps"),
  3444.     helpstring(""),
  3445.     ]
  3446.     BOOL  WINAPI GetRasterizerCaps(LPRASTERIZER_STATUS, UINT);
  3447.  
  3448.     [
  3449.     usesgetlasterror,
  3450.     entry("GetRegionData"),
  3451.     helpstring(""),
  3452.     ]
  3453.     DWORD WINAPI GetRegionData(HRGN hrgn, DWORD, LPRGNDATA);
  3454.  
  3455.     [
  3456.     usesgetlasterror,
  3457.     entry("GetRgnBox"),
  3458.     helpstring(""),
  3459.     ]
  3460.     int   WINAPI GetRgnBox(HRGN hrgn, RECT * lprc);
  3461.     */
  3462.  
  3463.     [
  3464.     usesgetlasterror,
  3465.     entry("GetStockObject"),
  3466.     helpstring("Returns the handle of stock pen, brush or font specified by fnObject constant"),
  3467.     ]
  3468.     HGDIOBJ WINAPI GetStockObject(int fnObject);
  3469.  
  3470.  
  3471.     [
  3472.     usesgetlasterror,
  3473.     entry("GetStretchBltMode"),
  3474.     helpstring("Gets the mode for compressing blits (see STRETCH_ANDSCANS)"),
  3475.     ]
  3476.     int     WINAPI GetStretchBltMode(HDC hdc);
  3477.  
  3478.  
  3479.     [
  3480.     usesgetlasterror,
  3481.     entry("GetSystemPaletteEntries"),
  3482.     helpstring("Retrieves range of palette entries from the system palette associated with the specified device context"),
  3483.     ]
  3484.     UINT  WINAPI GetSystemPaletteEntries(HDC hdc, 
  3485.                                          UINT iStartIndex, 
  3486.                                          UINT nEntries,    
  3487.                                          LPPALETTEENTRY lppe);
  3488.  
  3489.     [
  3490.     usesgetlasterror,
  3491.     entry("GetSystemPaletteUse"),
  3492.     helpstring("Retrieves current state of the system (physical) palette for the specified device context (SYSPAL_NOSTATIC, SYSPAL_STATIC, or SYSPAL_ERROR)"), 
  3493.     ]
  3494.     UINT  WINAPI GetSystemPaletteUse(HDC hdc);
  3495.  
  3496.     /*
  3497.     [
  3498.     usesgetlasterror,
  3499.     entry("GetTextCharacterExtra"),
  3500.     helpstring(""),
  3501.     ]
  3502.     int   WINAPI GetTextCharacterExtra(HDC hdc);
  3503.  
  3504.     [
  3505.     usesgetlasterror,
  3506.     entry("GetTextAlign"),
  3507.     helpstring(""),
  3508.     ]
  3509.     UINT  WINAPI GetTextAlign(HDC hdc);
  3510.     */
  3511.  
  3512.     [
  3513.     usesgetlasterror,
  3514.     entry("GetTextColor"),
  3515.     helpstring("Gets the text (foreground) color of a DC"),
  3516.     ]
  3517.     COLORREF WINAPI GetTextColor(HDC hdc);
  3518.  
  3519.  
  3520.     [
  3521.     usesgetlasterror,
  3522.     #ifdef UNICODE
  3523.     entry("GetTextExtentPointW"),
  3524.     #else
  3525.     entry("GetTextExtentPointA"),
  3526.     #endif
  3527.     helpstring("Computes the width and height of the specified string of text"),
  3528.     ]
  3529.     BOOL  WINAPI GetTextExtentPoint(HDC hDC, LPCTSTR lpString, 
  3530.                                     int cbString, LPSIZEL lpSize);
  3531.  
  3532.     [
  3533.     usesgetlasterror,
  3534.     #ifdef UNICODE
  3535.     entry("GetTextExtentPoint32W"),
  3536.     #else
  3537.     entry("GetTextExtentPoint32A"),
  3538.     #endif
  3539.     helpstring("Computes the width and height of the specified string of text"),
  3540.     ]
  3541.     BOOL  WINAPI GetTextExtentPoint32(HDC hdc, LPCTSTR lpString, 
  3542.                                         int cbString, LPSIZEL lpSize);
  3543.  
  3544.  
  3545.     [
  3546.     usesgetlasterror,
  3547.     #ifdef UNICODE
  3548.     entry("GetTextExtentExPointW"),
  3549.     #else
  3550.     entry("GetTextExtentExPointA"),
  3551.     #endif
  3552.     helpstring("Retrieves the number of characters in a specified string that will fit within a specified space and fills an array with the text extent for each of those characters"),
  3553.     ]
  3554.     BOOL  WINAPI GetTextExtentExPoint(HDC hdc, LPCTSTR lpszStr,    
  3555.                                       int cchString, int nMaxExtent,    
  3556.                                       INT * lpnFit,    INT * alpDx,    
  3557.                                       LPSIZEL lpSize);
  3558.  
  3559.     /*
  3560.     [
  3561.     usesgetlasterror,
  3562.     entry("GetTextCharset"),
  3563.     helpstring(""),
  3564.     ]
  3565.     int WINAPI GetTextCharset(HDC hdc);
  3566.  
  3567.     [
  3568.     usesgetlasterror,
  3569.     entry("GetTextCharsetInfo"),
  3570.     helpstring(""),
  3571.     ]
  3572.     int WINAPI GetTextCharsetInfo(HDC hdc, LPFONTSIGNATURE lpSig, DWORD dwFlags);
  3573.  
  3574.     [
  3575.     usesgetlasterror,
  3576.     entry("TranslateCharsetInfo("),
  3577.     helpstring(""),
  3578.     ]
  3579.     BOOL WINAPI TranslateCharsetInfo( DWORD *lpSrc, LPCHARSETINFO lpCs, DWORD dwFlags);
  3580.  
  3581.     [
  3582.     usesgetlasterror,
  3583.     entry("GetFontLanguageInfo("),
  3584.     helpstring(""),
  3585.     ]
  3586.     DWORD WINAPI GetFontLanguageInfo( HDC hdc );
  3587.  
  3588.     [
  3589.     usesgetlasterror,
  3590.     #ifdef UNICODE
  3591.     entry("GetCharacterPlacementW"),
  3592.     #else
  3593.     entry("GetCharacterPlacementA"),
  3594.     #endif
  3595.     helpstring(""),
  3596.     ]
  3597.     DWORD WINAPI GetCharacterPlacement(HDC hdc, LPCTSTR, int, int, LPGCP_RESULTSA, DWORD);
  3598.  
  3599.  
  3600.     [
  3601.     usesgetlasterror,
  3602.     entry("GetViewportExtEx"),
  3603.     helpstring(""),
  3604.     ]
  3605.     BOOL  WINAPI GetViewportExtEx(HDC hdc, LPSIZE);
  3606.  
  3607.     [
  3608.     usesgetlasterror,
  3609.     entry("GetViewportOrgEx"),
  3610.     helpstring(""),
  3611.     ]
  3612.     BOOL  WINAPI GetViewportOrgEx(HDC hdc, POINTL * lpPoint);
  3613.     */
  3614.  
  3615.     [
  3616.     usesgetlasterror,
  3617.     entry("GetWindowExtEx"),
  3618.     helpstring("Retrieves x-extents and y-extents of the window for the specified device context"),
  3619.     ]
  3620.     BOOL    WINAPI GetWindowExtEx(HDC hdc, SIZE * lpSize);
  3621.  
  3622.     /*
  3623.  
  3624.     [
  3625.     usesgetlasterror,
  3626.     entry("IntersectClipRect"),
  3627.     helpstring(""),
  3628.     ]
  3629.     int  WINAPI IntersectClipRect(HDC hdc, int, int, int, int);
  3630.  
  3631.     [
  3632.     usesgetlasterror,
  3633.     entry("InvertRgn"),
  3634.     helpstring(""),
  3635.     ]
  3636.     BOOL WINAPI InvertRgn(HDC hdc, HRGN hrgn);
  3637.  
  3638.     [
  3639.     usesgetlasterror,
  3640.     #ifdef UNICODE
  3641.     entry("LineDDW"),
  3642.     #else
  3643.     entry("LineDDA"),
  3644.     #endif
  3645.     helpstring(""),
  3646.     ]
  3647.     BOOL WINAPI LineDD(int, int, int, int, LINEDDAPROC, LPARAM lParam);
  3648.     */
  3649.  
  3650.     [
  3651.     usesgetlasterror,
  3652.     entry("LineTo"),
  3653.     helpstring("Draws from current position to (x,y) with current pen"),
  3654.     ]
  3655.     BOOL    WINAPI LineTo(HDC hdc, int X, int Y);
  3656.  
  3657.     [
  3658.     usesgetlasterror,
  3659.     entry("MaskBlt"),
  3660.     helpstring("Combines source and destination of two DCs with a monochrome bitmap mask according to combined foreground and background ROP modes"),
  3661.     ]
  3662.     BOOL    WINAPI MaskBlt(HDC hdcDest,
  3663.                            int nXDest, int nYDest,
  3664.                            int nWidth, int nHeight,
  3665.                            HDC hdcSrc,
  3666.                            int nXSrc, int nYSrc,
  3667.                            HBITMAP hbmMask,
  3668.                            int xMask, int yMask,
  3669.                            DWORD dwRop);
  3670.  
  3671.     [
  3672.     usesgetlasterror,
  3673.     entry("PlgBlt"),
  3674.     helpstring("Combines source, destination, and pattern of two DCs according to ROP mode"),
  3675.     ]
  3676.     BOOL    WINAPI PlgBlt(HDC hdcDest,
  3677.                           WORD * lpPoint,
  3678.                           HDC hdcSrc,
  3679.                           int nXSrc, int nYSrc,
  3680.                           int nWidth, int nHeight,
  3681.                           HBITMAP hbmMask,
  3682.                           int sMask, int yMask);
  3683.  
  3684.     /*
  3685.  
  3686.     [
  3687.     usesgetlasterror,
  3688.     entry("OffsetClipRgn"),
  3689.     helpstring(""),
  3690.     ]
  3691.     int  WINAPI OffsetClipRgn(HDC hdc, int, int);
  3692.  
  3693.     [
  3694.     usesgetlasterror,
  3695.     entry("OffsetRgn"),
  3696.     helpstring(""),
  3697.     ]
  3698.     int  WINAPI OffsetRgn(HRGN hrgn, int, int);
  3699.     */
  3700.  
  3701.     [
  3702.     usesgetlasterror,
  3703.     entry("PatBlt"),
  3704.     helpstring("Combines select brush and destination pattern on DC according to ROP mode"),
  3705.     ]
  3706.     BOOL    WINAPI PatBlt(HDC hdc,
  3707.                           int nLeftRect, int nTopRect,
  3708.                           int nWidth, int nHeight,
  3709.                           DWORD fdwRop);
  3710.  
  3711.     [
  3712.     usesgetlasterror,
  3713.     entry("Pie"),
  3714.     helpstring("Draws a pie-shaped wedge bounded by the intersection of an ellipse and two radials"),
  3715.     ]
  3716.     BOOL WINAPI Pie(HDC hDC,
  3717.                     int nLeftRect, int nTopRect,
  3718.                     int nRightRect, int nBottomRect,
  3719.                     int nXRadial1, int nYRadial1,
  3720.                     int nXRadial2, int nYRadial2);
  3721.  
  3722.     [
  3723.     usesgetlasterror,
  3724.     entry("PlayMetaFile"),
  3725.     helpstring("Plays hmf metafile on hdc device"),
  3726.     ]
  3727.     BOOL    WINAPI PlayMetaFile(HDC hdc, HMETAFILE hmf);
  3728.  
  3729.     /*
  3730.  
  3731.     [
  3732.     usesgetlasterror,
  3733.     entry("PaintRgn"),
  3734.     helpstring(""),
  3735.     ]
  3736.     BOOL WINAPI PaintRgn(HDC hdc, HRGN hrgn);
  3737.     */
  3738.  
  3739.     [
  3740.     usesgetlasterror,
  3741.     entry("PolyPolygon"),
  3742.     helpstring("Draws a series of closed polygons, each outlined with current pen and filled with current brush and fill mode"),
  3743.     ]
  3744.     BOOL WINAPI PolyPolygon(HDC hdc, POINTL * lpPoints,
  3745.                             int * lpPolyCounts, int cPoints);
  3746.  
  3747.     /*
  3748.  
  3749.     [
  3750.     usesgetlasterror,
  3751.     entry("PolyPolygon"),
  3752.     helpstring(""),
  3753.     ]
  3754.     BOOL WINAPI PolyPolygon(HDC hdc, POINTL * lppt, INT *, int);
  3755.  
  3756.     [
  3757.     usesgetlasterror,
  3758.     entry("PtInRegion"),
  3759.     helpstring(""),
  3760.     ]
  3761.     BOOL WINAPI PtInRegion(HRGN hrgn, int, int);
  3762.  
  3763.     [
  3764.     usesgetlasterror,
  3765.     entry("PtVisible"),
  3766.     helpstring(""),
  3767.     ]
  3768.     BOOL WINAPI PtVisible(HDC hdc, int, int);
  3769.  
  3770.     [
  3771.     usesgetlasterror,
  3772.     entry("RectInRegion"),
  3773.     helpstring(""),
  3774.     ]
  3775.     BOOL WINAPI RectInRegion(HRGN hrgn, RECT * lprc);
  3776.  
  3777.     [
  3778.     usesgetlasterror,
  3779.     entry("RectVisible"),
  3780.     helpstring(""),
  3781.     ]
  3782.     BOOL WINAPI RectVisible(HDC hdc, RECT * lprc);
  3783.     */
  3784.  
  3785.     [
  3786.     usesgetlasterror,
  3787.     entry("Rectangle"),
  3788.     helpstring("Draws rectangle around given points with current pen filled with current brush"),
  3789.     ]
  3790.     BOOL    WINAPI Rectangle(HDC hdc,
  3791.                              int nLeft, int nTop,
  3792.                              int nRight, int nBottom);
  3793.  
  3794.     /*
  3795.  
  3796.     [
  3797.     usesgetlasterror,
  3798.     entry("Rectangle"),
  3799.     helpstring(""),
  3800.     ]
  3801.     BOOL WINAPI Rectangle(HDC hdc, int, int, int, int);
  3802.  
  3803.     [
  3804.     usesgetlasterror,
  3805.     entry("RestoreDC"),
  3806.     helpstring(""),
  3807.     ]
  3808.     BOOL WINAPI RestoreDC(HDC hdc, int);
  3809.  
  3810.     [
  3811.     usesgetlasterror,
  3812.     #ifdef UNICODE
  3813.     entry("ResetDCW"),
  3814.     #else
  3815.     entry("ResetDCA"),
  3816.     #endif
  3817.     helpstring(""),
  3818.     ]
  3819.     HDC WINAPI ResetDC(HDC hdc, DEVMODE *);
  3820.     */
  3821.  
  3822.     [
  3823.     usesgetlasterror,
  3824.     entry("RealizePalette"),
  3825.     helpstring("Maps palette entries from the current logical palette to the system palette"),
  3826.     ]
  3827.     UINT WINAPI RealizePalette(HDC hdc);
  3828.  
  3829.     /*
  3830.     [
  3831.     usesgetlasterror,
  3832.     #ifdef UNICODE
  3833.     entry("RemoveFontResourceW"),
  3834.     #else
  3835.     entry("RemoveFontResourceA"),
  3836.     #endif
  3837.     helpstring(""),
  3838.     ]
  3839.     BOOL WINAPI RemoveFontResource(LPCTSTR);
  3840.     */
  3841.  
  3842.     [
  3843.     usesgetlasterror,
  3844.     entry("RoundRect"),
  3845.     helpstring("Draws rounded rectangle around given points with current pen and filled with current brush, using ellipse of (nWidth, nHeight) on corners"),
  3846.     ]
  3847.     BOOL    WINAPI RoundRect(HDC hdc,
  3848.                              int nLeft, int nTop,
  3849.                              int nRight, int nBottom,
  3850.                              int nWidth, int nHeight);
  3851.  
  3852.  
  3853.     [
  3854.     usesgetlasterror,
  3855.     entry("ResizePalette"),
  3856.     helpstring("Increases or decreases the size of a logical palette based on the specified value"),
  3857.     ]
  3858.     BOOL WINAPI ResizePalette(HPALETTE hpal, UINT nEntries);
  3859.  
  3860.     /*
  3861.     [
  3862.     usesgetlasterror,
  3863.     entry("SaveDC"),
  3864.     helpstring(""),
  3865.     ]
  3866.     int  WINAPI SaveDC(HDC hdc);
  3867.  
  3868.     [
  3869.     usesgetlasterror,
  3870.     entry("SelectClipRgn"),
  3871.     helpstring(""),
  3872.     ]
  3873.     int  WINAPI SelectClipRgn(HDC hdc, HRGN hrgn);
  3874.  
  3875.     [
  3876.     usesgetlasterror,
  3877.     entry("ExtSelectClipRgn"),
  3878.     helpstring(""),
  3879.     ]
  3880.     int  WINAPI ExtSelectClipRgn(HDC hdc, HRGN hrgn, int);
  3881.  
  3882.     [
  3883.     usesgetlasterror,
  3884.     entry("SetMetaRgn"),
  3885.     helpstring(""),
  3886.     ]
  3887.     int  WINAPI SetMetaRgn(HDC hdc);
  3888.     */
  3889.  
  3890.     [
  3891.     usesgetlasterror,
  3892.     entry("SelectObject"),
  3893.     helpstring("Selects a given GDI object into a DC, returning the previous object"),
  3894.     ]
  3895.     HGDIOBJ WINAPI SelectObject(HDC hdc, HGDIOBJ hgdiobj);
  3896.  
  3897.     [
  3898.     usesgetlasterror,
  3899.     entry("SelectPalette"),
  3900.     helpstring("Selects the specified logical palette into a device context"),
  3901.     ]
  3902.     HPALETTE WINAPI SelectPalette(HDC hdc, HPALETTE hpal, 
  3903.                                   BOOL bForceBackground);
  3904.  
  3905.     [
  3906.     usesgetlasterror,
  3907.     entry("SetBkColor"),
  3908.     helpstring("Set the background color of a DC"),
  3909.     ]
  3910.     COLORREF WINAPI SetBkColor(HDC hdc, COLORREF clrref);
  3911.  
  3912.     [
  3913.     usesgetlasterror,
  3914.     entry("SetBkMode"),
  3915.     helpstring("Set the background mode of a DC"),
  3916.     ]
  3917.     int     WINAPI SetBkMode(HDC hdc, int fnBkMode);
  3918.  
  3919.  
  3920.     [
  3921.     usesgetlasterror,
  3922.     entry("SetBitmapBits"),
  3923.     helpstring("Gets version numbers of Windows and MS-DOS"),
  3924.     ]
  3925.     LONG    WINAPI SetBitmapBits(HBITMAP hbm, LONG cbBuffer, BYTE * lpvBits);
  3926.  
  3927.     [
  3928.     usesgetlasterror,
  3929.     entry("SetBoundsRect"),
  3930.     helpstring("Controls the accumulation of bounding rectangle information for the specified device context"),
  3931.     ]
  3932.     UINT  WINAPI SetBoundsRect(HDC hdc, RECT * lprc, UINT);
  3933.  
  3934.     [
  3935.     usesgetlasterror,
  3936.     entry("SetDIBits"),
  3937.     helpstring("Sets the pixels in a bitmap using the color data found in the specified device-independent bitmap (DIB)"),
  3938.     ]
  3939.     int   WINAPI SetDIBits(HDC hdc, 
  3940.                            HBITMAP hbmp,    
  3941.                            UINT uStartScan,
  3942.                            UINT cScanLines,
  3943.                            LPVOID lpvBits,
  3944.                            LPVOID lpbmi,
  3945.                            UINT fuColorUse);     
  3946.  
  3947.     [
  3948.     usesgetlasterror,
  3949.     entry("SetDIBitsToDevice"),
  3950.     helpstring("Sets the pixels in the specified rectangle on the device that is associated with the destination device context using color data from a device-independent bitmap (DIB)"),
  3951.     ]
  3952.     int   WINAPI SetDIBitsToDevice(HDC hdc, 
  3953.                                     int XDest,    
  3954.                                     int YDest,    
  3955.                                     DWORD dwWidth,    
  3956.                                     DWORD dwHeight,    
  3957.                                     int XSrc,    
  3958.                                     int YSrc,    
  3959.                                     UINT uStartScan,    
  3960.                                     UINT cScanLines,    
  3961.                                     LPVOID lpvBits,
  3962.                                     LPVOID lpbmi,
  3963.                                     UINT fuColorUse);
  3964.       
  3965.  
  3966.     /*
  3967.     [
  3968.     usesgetlasterror,
  3969.     entry("SetMapperFlags"),
  3970.     helpstring(""),
  3971.     ]
  3972.     DWORD WINAPI SetMapperFlags(HDC hdc, DWORD);
  3973.  
  3974.     [
  3975.     usesgetlasterror,
  3976.     entry("SetGraphicsMode"),
  3977.     helpstring(""),
  3978.     ]
  3979.     int   WINAPI SetGraphicsMode(HDC hdc, int iMode);
  3980.  
  3981.     [
  3982.     usesgetlasterror,
  3983.     entry("SetMapMode"),
  3984.     helpstring(""),
  3985.     ]
  3986.     int   WINAPI SetMapMode(HDC hdc, int);
  3987.     */
  3988.  
  3989.     [
  3990.     usesgetlasterror,
  3991.     entry("SetMetaFileBitsEx"),
  3992.     helpstring("Creates a metafile from global memory"),
  3993.     ]
  3994.     HMETAFILE   WINAPI SetMetaFileBitsEx(UINT nSize, LPVOID lpData);
  3995.  
  3996.     [
  3997.     usesgetlasterror,
  3998.     entry("SetPaletteEntries"),
  3999.     helpstring("Sets RGB (red, green, blue) color values and flags in a range of entries in a logical palette"),
  4000.     ]
  4001.     UINT  WINAPI SetPaletteEntries(HPALETTE hpal, 
  4002.                                    UINT iStart, UINT cEntries, 
  4003.                                    PALETTEENTRY * lppe);
  4004.  
  4005.     [
  4006.     usesgetlasterror,
  4007.     entry("SetPixel"),
  4008.     helpstring("Sets pixel at (x,y) to given color"),
  4009.     ]
  4010.     COLORREF WINAPI SetPixel(HDC hdc,
  4011.                              int nXPos, int nYPos,
  4012.                              COLORREF clrref);
  4013.  
  4014.     /*
  4015.  
  4016.     [
  4017.     usesgetlasterror,
  4018.     entry("SetPixelV"),
  4019.     helpstring(""),
  4020.     ]
  4021.     BOOL   WINAPI SetPixelV(HDC hdc, int, int, COLORREF clrref);
  4022.  
  4023.     [
  4024.     usesgetlasterror,
  4025.     entry("SetPixelFormat"),
  4026.     helpstring(""),
  4027.     ]
  4028.     BOOL  WINAPI SetPixelFormat(HDC hdc, int, PIXELFORMATDESCRIPTOR *);
  4029.     */
  4030.  
  4031.     [
  4032.     usesgetlasterror,
  4033.     entry("SetPolyFillMode"),
  4034.     helpstring("Sets polygon fill mode for functions that fill polygons"),
  4035.     ]
  4036.     int  WINAPI SetPolyFillMode(HDC hdc, int iPolyFillMode);
  4037.  
  4038.     [
  4039.     usesgetlasterror,
  4040.     entry("StretchBlt"),
  4041.     helpstring("Combines select brush and destination pattern on DC according to ROP mode while changing size"),
  4042.     ]
  4043.     BOOL WINAPI StretchBlt(HDC hdcDest,
  4044.                            int nXOriginDest, int nYOriginDest,
  4045.                            int bWidthDest, int nHeightDest,
  4046.                            HDC hdcSrc,
  4047.                            int nXOriginSrc, int nYOriginSrc,
  4048.                            int nWidthSrc, int nHeightSrc,
  4049.                            DWORD dwRop);
  4050.  
  4051.     [
  4052.     usesgetlasterror,
  4053.     entry("SetRectRgn"),
  4054.     helpstring("Changes a region into a rectangular region with the specified coordinates"),
  4055.     ]
  4056.     BOOL   WINAPI SetRectRgn(HRGN hrgn, 
  4057.                              int nLeftRect,    
  4058.                              int nTopRect,    
  4059.                              int nRightRect,    
  4060.                              int nBottomRect);
  4061.   
  4062.     [
  4063.     usesgetlasterror,
  4064.     entry("StretchDIBits"),
  4065.     helpstring("Copies the color data for a rectangle of pixels in a device-independent bitmap (DIB) to the specified destination rectangle"),
  4066.     ]
  4067.     int   WINAPI StretchDIBits(HDC hdc, 
  4068.                                int XDest,    
  4069.                                int YDest,    
  4070.                                int nDestWidth,    
  4071.                                int nDestHeight,    
  4072.                                int XSrc,    
  4073.                                int YSrc,    
  4074.                                int nSrcWidth,    
  4075.                                int nSrcHeight,    
  4076.                                LPVOID lpBits,
  4077.                                LPVOID lpBitsInfo,
  4078.                                UINT iUsage,    
  4079.                                DWORD dwRop);
  4080.     
  4081.  
  4082.     [
  4083.     usesgetlasterror,
  4084.     entry("SetROP2"),
  4085.     helpstring("Sets the current foreground mix mode"),
  4086.     ]
  4087.     int   WINAPI SetROP2(HDC hdc, int fnDrawMode);
  4088.  
  4089.     [
  4090.     usesgetlasterror,
  4091.     entry("SetStretchBltMode"),
  4092.     helpstring("Sets the mode for compressing blits (see STRETCH_ANDSCANS)"),
  4093.     ]
  4094.     int     WINAPI SetStretchBltMode(HDC hdc, int fnStretchMode);
  4095.  
  4096.  
  4097.     [
  4098.     usesgetlasterror,
  4099.     entry("SetSystemPaletteUse"),
  4100.     helpstring("Allows an application to specify whether the system palette contains 2 (SYSPAL_NOSTATIC) or 20 (SYSPAL_STATIC) static colors"),
  4101.     ]
  4102.     UINT  WINAPI SetSystemPaletteUse(HDC hdc, UINT uUsage);
  4103.  
  4104.     /*
  4105.     [
  4106.     usesgetlasterror,
  4107.     entry("SetTextCharacterExtra"),
  4108.     helpstring(""),
  4109.     ]
  4110.     int   WINAPI SetTextCharacterExtra(HDC hdc, int);
  4111.     */
  4112.  
  4113.     [
  4114.     usesgetlasterror,
  4115.     entry("SetTextColor"),
  4116.     helpstring("Sets the text (foreground) color of a DC"),
  4117.     ]
  4118.     COLORREF WINAPI SetTextColor(HDC hdc, COLORREF clrref);
  4119.  
  4120.     /*
  4121.  
  4122.     [
  4123.     usesgetlasterror,
  4124.     entry("SetTextAlign"),
  4125.     helpstring(""),
  4126.     ]
  4127.     UINT  WINAPI SetTextAlign(HDC hdc, UINT);
  4128.  
  4129.     [
  4130.     usesgetlasterror,
  4131.     entry("SetTextJustification"),
  4132.     helpstring(""),
  4133.     ]
  4134.     BOOL  WINAPI SetTextJustification(HDC hdc, int, int);
  4135.  
  4136.     [
  4137.     usesgetlasterror,
  4138.     entry("UpdateColors"),
  4139.     helpstring(""),
  4140.     ]
  4141.     BOOL  WINAPI UpdateColors(HDC hdc);
  4142.  
  4143.  
  4144.     [
  4145.     usesgetlasterror,
  4146.     entry("PlayMetaFileRecord"),
  4147.     helpstring(""),
  4148.     ]
  4149.     BOOL  WINAPI PlayMetaFileRecord(HDC hdc, LPHANDLETABLE, LPMETARECORD, UINT);
  4150.     */
  4151.  
  4152.     [
  4153.     usesgetlasterror,
  4154.     entry("EnumMetaFile"),
  4155.     helpstring("Enumerates the records within a Windows-format metafile by retrieving each record and passing it to the specified callback function"),
  4156.     ]
  4157.     BOOL  WINAPI EnumMetaFile(HDC hdc, 
  4158.                               HMETAFILE hmf, 
  4159.                               MFENUMPROC lpMetaFunc, 
  4160.                               LPARAM lParam);
  4161.  
  4162.     // Enhanced Metafile Function Declarations
  4163.  
  4164.  
  4165.     [
  4166.     usesgetlasterror,
  4167.     entry("CloseEnhMetaFile"),
  4168.     helpstring("Closes an enhanced-metafile device context and returns a handle to the metafile."),
  4169.     ]
  4170.     HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc);
  4171.     
  4172.     [
  4173.     usesgetlasterror,
  4174.     #ifdef UNICODE
  4175.     entry("CopyEnhMetaFileW"),
  4176.     #else
  4177.     entry("CopyEnhMetaFileA"),
  4178.     #endif
  4179.     helpstring("Copies contents of enhanced-format metafile to specified file."),
  4180.     ]
  4181.     HENHMETAFILE WINAPI CopyEnhMetaFile(HENHMETAFILE hemf,
  4182.                                         LPCTSTR lpszFile);
  4183.     
  4184.     [
  4185.     usesgetlasterror,
  4186.     #ifdef UNICODE
  4187.     entry("CreateEnhMetaFileW"),
  4188.     #else
  4189.     entry("CreateEnhMetaFileA"),
  4190.     #endif
  4191.     helpstring("Creates device context for enhanced-format metafile."),
  4192.     ]
  4193.     HDC   WINAPI CreateEnhMetaFile(HDC hdc, LPCTSTR lpFileName,
  4194.                                    int * lpRect,
  4195.                                    LPCTSTR lpDescription);
  4196.     
  4197.     [
  4198.     usesgetlasterror,
  4199.     entry("DeleteEnhMetaFile"),
  4200.     helpstring("Deletes an enhanced-format metafile or metafile handle."),
  4201.     ]
  4202.     BOOL  WINAPI DeleteEnhMetaFile(HENHMETAFILE hemf);
  4203.     
  4204.     [
  4205.     usesgetlasterror,
  4206.     entry("EnumEnhMetaFile"),
  4207.     helpstring("Enumerates the records within an enhanced-format metafile by retrieving each record and passing it to the specified callback function"),
  4208.     ]
  4209.     BOOL  WINAPI EnumEnhMetaFile(HDC hdc, 
  4210.                                  HENHMETAFILE hemf, 
  4211.                                  ENHMFENUMPROC lpEnhMetaFunc, 
  4212.                                  LPVOID lpData, 
  4213.                                  RECT * lpRect);
  4214.     
  4215.     [
  4216.     usesgetlasterror,
  4217.     #ifdef UNICODE
  4218.     entry("GetEnhMetaFileW"),
  4219.     #else
  4220.     entry("GetEnhMetaFileA"),
  4221.     #endif
  4222.     helpstring("Creates handle for given file-based enhanced-format metafile"),
  4223.     ]
  4224.     HENHMETAFILE WINAPI GetEnhMetaFile(LPCTSTR lpszMetaFile);
  4225.  
  4226.     [
  4227.     usesgetlasterror,
  4228.     entry("GetEnhMetaFileBits"),
  4229.     helpstring("Copies contents of specified enhanced-format metafile into buffer"),
  4230.     ]
  4231.     UINT  WINAPI GetEnhMetaFileBits(HENHMETAFILE hemf,
  4232.                                     UINT cbBuffer,
  4233.                                     BYTE * lpbBuffer);
  4234.  
  4235.     [
  4236.     usesgetlasterror,
  4237.     #ifdef UNICODE
  4238.     entry("GetEnhMetaFileDescriptionW"),
  4239.     #else
  4240.     entry("GetEnhMetaFileDescriptionA"),
  4241.     #endif
  4242.     helpstring("Copies optional text description from an enhanced-format metafile to a specified buffer.")
  4243.     ]
  4244.     UINT  WINAPI GetEnhMetaFileDescription(HENHMETAFILE hemf,
  4245.                                            UINT cchBuffer,
  4246.                                            LPTSTR lpszDescription);
  4247.  
  4248.     /*
  4249.     [
  4250.     usesgetlasterror,
  4251.     entry("GetEnhMetaFileHeader"),
  4252.     helpstring(""),
  4253.     ]
  4254.     UINT  WINAPI GetEnhMetaFileHeader(HENHMETAFILE hemf,
  4255.                                       UINT cbBuffer,
  4256.                                       LPENHMETAHEADER lpemnh);
  4257.  
  4258.     [
  4259.     usesgetlasterror,
  4260.     entry("GetEnhMetaFilePaletteEntries"),
  4261.     helpstring(""),
  4262.     ]
  4263.     UINT  WINAPI GetEnhMetaFilePaletteEntries(HENHMETAFILE hemf,
  4264.                                               UINT, 
  4265.                                               LPPALETTEENTRY );
  4266.     */
  4267.  
  4268.     [
  4269.     usesgetlasterror,
  4270.     entry("GetWinMetaFileBits"),
  4271.     helpstring("Converts enhanced-format records from metafile into Windows-format records and copies converted records to specified buffer."),
  4272.     ]
  4273.     UINT  WINAPI GetWinMetaFileBits(HENHMETAFILE hemf,
  4274.                                     UINT cbBuffer,
  4275.                                     BYTE * lpbBuffer,
  4276.                                     INT fnMapMode,
  4277.                                     HDC hdc);
  4278.  
  4279.     [
  4280.     usesgetlasterror,
  4281.     entry("PlayEnhMetaFile"),
  4282.     helpstring("Displays the picture in specified enhanced-format metafile."),
  4283.     ]
  4284.     BOOL  WINAPI PlayEnhMetaFile(HDC hdc, HENHMETAFILE hemf,
  4285.                                  int * lpRect);
  4286.  
  4287.     /*
  4288.     [
  4289.     usesgetlasterror,
  4290.     entry("PlayEnhMetaFileRecord"),
  4291.     helpstring(""),
  4292.     ]
  4293.     BOOL  WINAPI PlayEnhMetaFileRecord(HDC hdc, LPHANDLETABLE, ENHMETARECORD *, UINT);
  4294.     */
  4295.  
  4296.     [
  4297.     usesgetlasterror,
  4298.     entry("SetEnhMetaFileBits"),
  4299.     helpstring("Creates memory-based enhanced-format metafile from supplied data."),
  4300.     ]
  4301.     HENHMETAFILE WINAPI SetEnhMetaFileBits(UINT cbBuffer,
  4302.                                            BYTE * lpData);
  4303.  
  4304.     /*
  4305.     [
  4306.     usesgetlasterror,
  4307.     entry("SetWinMetaFileBits"),
  4308.     helpstring(""),
  4309.     ]
  4310.     HENHMETAFILE  WINAPI SetWinMetaFileBits(UINT cbBuffer,
  4311.                                             BYTE * lpbBuffer,
  4312.                                             HDC hdc,
  4313.                                             long * lpmfp);
  4314.     */
  4315.  
  4316.     [
  4317.     usesgetlasterror,
  4318.     entry("GdiComment"),
  4319.     helpstring("Copies a comment from a buffer into specified enhanced-format metafile."),
  4320.     ]
  4321.     BOOL  WINAPI GdiComment(HDC hdc, UINT cbSize,
  4322.                             BYTE * lpData);
  4323.  
  4324.     /*
  4325.     BOOL WINAPI GetTextMetrics(HDC hdc, LPTEXTMETRICA);
  4326.     */
  4327.  
  4328.     // new GDI 
  4329.  
  4330.     /*
  4331.  
  4332.     [
  4333.     usesgetlasterror,
  4334.     entry("AngleArc"),
  4335.     helpstring(""),
  4336.     ]
  4337.     BOOL WINAPI AngleArc(HDC hdc, int, int, DWORD, FLOAT, FLOAT);
  4338.  
  4339.     [
  4340.     usesgetlasterror,
  4341.     entry("PolyPolyline"),
  4342.     helpstring(""),
  4343.     ]
  4344.     BOOL WINAPI PolyPolyline(HDC hdc, POINTL * lppt, const UINT *, DWORD);
  4345.  
  4346.     [
  4347.     usesgetlasterror,
  4348.     entry("GetWorldTransform"),
  4349.     helpstring(""),
  4350.     ]
  4351.     BOOL WINAPI GetWorldTransform(HDC hdc, LPXFORM);
  4352.  
  4353.     [
  4354.     usesgetlasterror,
  4355.     entry("SetWorldTransform"),
  4356.     helpstring(""),
  4357.     ]
  4358.     BOOL WINAPI SetWorldTransform(HDC hdc, XFORM *);
  4359.  
  4360.     [
  4361.     usesgetlasterror,
  4362.     entry("ModifyWorldTransform"),
  4363.     helpstring(""),
  4364.     ]
  4365.     BOOL WINAPI ModifyWorldTransform(HDC hdc, XFORM *, DWORD);
  4366.  
  4367.     [
  4368.     usesgetlasterror,
  4369.     entry("CombineTransform"),
  4370.     helpstring(""),
  4371.     ]
  4372.     BOOL WINAPI CombineTransform(LPXFORM, XFORM *, XFORM *);
  4373.     */
  4374.  
  4375.     [
  4376.     usesgetlasterror,
  4377.     entry("CreateDIBSection"),
  4378.     helpstring("Creates a device-independent bitmap (DIB) that applications can write to directly"),
  4379.     ]
  4380.     HBITMAP WINAPI CreateDIBSection(HDC hdc, 
  4381.                                     LPVOID pbmi,
  4382.                                     UINT iUsage,    
  4383.                                     VOID *ppvBits,    
  4384.                                     HANDLE hSection,
  4385.                                     DWORD dwOffset);
  4386.  
  4387.     [
  4388.     usesgetlasterror,
  4389.     entry("GetDIBColorTable"),
  4390.     helpstring("Retrieves RGB (red, green, blue) color values from a range of entries in the color table of the DIB section bitmap that is currently selected into a specified device context"),
  4391.     ]
  4392.     UINT WINAPI GetDIBColorTable(HDC hdc, 
  4393.                                  UINT uStartIndex,    
  4394.                                  UINT cEntries,    
  4395.                                  RGBQUAD * pColors);    
  4396.  
  4397.     [
  4398.     usesgetlasterror,
  4399.     entry("SetDIBColorTable"),
  4400.     helpstring("Sets RGB (red, green, blue) color values in a range of entries in the color table of the device-independent bitmap (DIB) that is currently selected into a specified device context"),
  4401.     ]
  4402.     UINT WINAPI SetDIBColorTable(HDC hdc, 
  4403.                                  UINT uStartIndex,    
  4404.                                  UINT cEntries,    
  4405.                                  RGBQUAD * pColors);    
  4406.  
  4407.     // Flags value for COLORADJUSTMENT 
  4408.     const UINT CA_NEGATIVE                 = 0x0001;
  4409.     const UINT CA_LOG_FILTER               = 0x0002;
  4410.  
  4411.     // IlluminantIndex values 
  4412.     const int ILLUMINANT_DEVICE_DEFAULT   = 0;
  4413.     const int ILLUMINANT_A                = 1;
  4414.     const int ILLUMINANT_B                = 2;
  4415.     const int ILLUMINANT_C                = 3;
  4416.     const int ILLUMINANT_D50              = 4;
  4417.     const int ILLUMINANT_D55              = 5;
  4418.     const int ILLUMINANT_D65              = 6;
  4419.     const int ILLUMINANT_D75              = 7;
  4420.     const int ILLUMINANT_F2               = 8;
  4421.     const int ILLUMINANT_MAX_INDEX        = 8; // ILLUMINANT_F2
  4422.  
  4423.     const int ILLUMINANT_TUNGSTEN         = 1; // ILLUMINANT_A
  4424.     const int ILLUMINANT_DAYLIGHT         = 3; // ILLUMINANT_C
  4425.     const int ILLUMINANT_FLUORESCENT      = 8; // ILLUMINANT_F2
  4426.     const int ILLUMINANT_NTSC             = 3; // ILLUMINANT_C
  4427.  
  4428.     // Min and max for RedGamma, GreenGamma, BlueGamma 
  4429.     const UINT RGB_GAMMA_MIN               = 02500;
  4430.     const UINT RGB_GAMMA_MAX               = 65000;
  4431.  
  4432.     // Min and max for ReferenceBlack and ReferenceWhite 
  4433.     const UINT REFERENCE_WHITE_MIN         = 6000;
  4434.     const UINT REFERENCE_WHITE_MAX         = 10000;
  4435.     const UINT REFERENCE_BLACK_MIN         = 0;
  4436.     const UINT REFERENCE_BLACK_MAX         = 4000;
  4437.  
  4438.     // Min and max for Contrast, Brightness, Colorfulness, RedGreenTint 
  4439.     const short COLOR_ADJ_MIN               = -100;
  4440.     const short COLOR_ADJ_MAX               = 100;
  4441.  
  4442.     /*
  4443.  
  4444.     [
  4445.     usesgetlasterror,
  4446.     entry("SetColorAdjustment"),
  4447.     helpstring(""),
  4448.     ]
  4449.     BOOL WINAPI SetColorAdjustment(HDC hdc, COLORADJUSTMENT *);
  4450.  
  4451.     [
  4452.     usesgetlasterror,
  4453.     entry("GetColorAdjustment"),
  4454.     helpstring(""),
  4455.     ]
  4456.     BOOL WINAPI GetColorAdjustment(HDC hdc, LPCOLORADJUSTMENT);
  4457.  
  4458.     */
  4459.  
  4460.     [
  4461.     usesgetlasterror,
  4462.     entry("CreateHalftonePalette"),
  4463.     helpstring("Creates a halftone palette for the specified device context"),
  4464.     ]
  4465.     HPALETTE WINAPI CreateHalftonePalette(HDC hdc);
  4466.  
  4467.     const int DI_APPBANDING   = 0x0001;
  4468.  
  4469.     /*
  4470.  
  4471.     [
  4472.     usesgetlasterror,
  4473.     #ifdef UNICODE
  4474.     entry("StartDocW"),
  4475.     #else
  4476.     entry("StartDocA"),
  4477.     #endif
  4478.     helpstring(""),
  4479.     ]
  4480.     int WINAPI StartDoc(HDC hdc, DOCINFO *);
  4481.  
  4482.     [
  4483.     usesgetlasterror,
  4484.     entry("EndDoc"),
  4485.     helpstring(""),
  4486.     ]
  4487.     int WINAPI EndDoc(HDC hdc);
  4488.  
  4489.     [
  4490.     usesgetlasterror,
  4491.     entry("StartPage"),
  4492.     helpstring(""),
  4493.     ]
  4494.     int WINAPI StartPage(HDC hdc);
  4495.  
  4496.     [
  4497.     usesgetlasterror,
  4498.     entry("EndPage"),
  4499.     helpstring(""),
  4500.     ]
  4501.     int WINAPI EndPage(HDC hdc);
  4502.  
  4503.     [
  4504.     usesgetlasterror,
  4505.     entry("AbortDoc"),
  4506.     helpstring(""),
  4507.     ]
  4508.     int WINAPI AbortDoc(HDC hdc);
  4509.  
  4510.     [
  4511.     usesgetlasterror,
  4512.     entry("SetAbortProc"),
  4513.     helpstring(""),
  4514.     ]
  4515.     int WINAPI SetAbortProc(HDC hdc, ABORTPROC);
  4516.     */
  4517.  
  4518.     [
  4519.     usesgetlasterror,
  4520.     entry("AbortPath"),
  4521.     helpstring("Closes and discards any paths in the specified device context"),
  4522.     ]
  4523.     BOOL WINAPI AbortPath(HDC hDC);
  4524.  
  4525.     [
  4526.     usesgetlasterror,
  4527.     entry("ArcTo"),
  4528.     helpstring("Draws an elliptical arc"),
  4529.     ]
  4530.     BOOL WINAPI ArcTo(HDC hDC,
  4531.                       int nLeftRect, int nTopRect,
  4532.                       int nRightRect, int nBottomRect,
  4533.                       int nXRadial1, int nYRadial1,
  4534.                       int nXRadial2, int nYRadial2);
  4535.  
  4536.     [
  4537.     usesgetlasterror,
  4538.     entry("BeginPath"),
  4539.     helpstring("Opens a path bracket in the specified device context"),
  4540.     ]
  4541.     BOOL WINAPI BeginPath(HDC hDC);
  4542.  
  4543.     [
  4544.     usesgetlasterror,
  4545.     entry("CloseFigure"),
  4546.     helpstring("Closes an open figure in a path"),
  4547.     ]
  4548.     BOOL WINAPI CloseFigure(HDC hDC);
  4549.  
  4550.     [
  4551.     usesgetlasterror,
  4552.     entry("EndPath"),
  4553.     helpstring("Closes a path bracket and selects the path into the specified device context"),
  4554.     ]
  4555.     BOOL WINAPI EndPath(HDC hDC);
  4556.  
  4557.     [
  4558.     usesgetlasterror,
  4559.     entry("FillPath"),
  4560.     helpstring("Closes any open figures in the current path and fills the path's interior using the current brush and polygon-filling modes"),
  4561.     ]
  4562.     BOOL WINAPI FillPath(HDC hDC);
  4563.  
  4564.     [
  4565.     usesgetlasterror,
  4566.     entry("FlattenPath"),
  4567.     helpstring("Transforms curves in the current path, turning each into a sequence of lines"),
  4568.     ]
  4569.     BOOL WINAPI FlattenPath(HDC hDC);
  4570.  
  4571.     [
  4572.     usesgetlasterror,
  4573.     entry("GetPath"),
  4574.     helpstring("Retrieves the coordinates defining the endpoints of lines and the control points of curves found in the current path"),
  4575.     ]
  4576.     int WINAPI GetPath(HDC hDC, int * lpPoints,
  4577.                        BYTE * lpTypes, int nSize);
  4578.  
  4579.     [
  4580.     usesgetlasterror,
  4581.     entry("PathToRegion"),
  4582.     helpstring("Creates a region from the current path"),
  4583.     ]
  4584.     HRGN WINAPI PathToRegion(HDC hDC);
  4585.  
  4586.     [
  4587.     usesgetlasterror,
  4588.     entry("PolyDraw"),
  4589.     helpstring("Draws a set of line segments and Bezier curves"),
  4590.     ]
  4591.     BOOL WINAPI PolyDraw(HDC hDC, int * lppt,
  4592.                          BYTE * lpbTypes, int cCount);
  4593.  
  4594.     [
  4595.     usesgetlasterror,
  4596.     entry("SelectClipPath"),
  4597.     helpstring("Selects the current path as a clipping region, combining the new region with any existing clipping region by using the specified mode"),
  4598.     ]
  4599.     BOOL WINAPI SelectClipPath(HDC hDC, int iMode);
  4600.  
  4601.     [
  4602.     usesgetlasterror,
  4603.     entry("SetArcDirection"),
  4604.     helpstring("Sets the drawing direction to be used for arc and rectangle functions to AD_COUNTERCLOCKWISE or AD_CLOCKWISE"),
  4605.     ]
  4606.     int WINAPI SetArcDirection(HDC hDC, int ArcDirection);
  4607.  
  4608. /*
  4609.     [
  4610.     usesgetlasterror,
  4611.     entry("SetMiterLimit"),
  4612.     helpstring("Sets the limit for the length of miter joins for the specified device context"),
  4613.     ]
  4614.     BOOL WINAPI SetMiterLimit(HDC hDC, FLOAT eNewLimit,
  4615.                               FLOAT * peOldLimit);
  4616. */
  4617.  
  4618.     [
  4619.     usesgetlasterror,
  4620.     entry("StrokeAndFillPath"),
  4621.     helpstring("Strokes the outline of the path with the current pen and fills with the current brush"),
  4622.     ]
  4623.     BOOL WINAPI StrokeAndFillPath(HDC hDC);
  4624.  
  4625.     [
  4626.     usesgetlasterror,
  4627.     entry("StrokePath"),
  4628.     helpstring("Strokes the outline of the path with the current pen"),
  4629.     ]
  4630.     BOOL WINAPI StrokePath(HDC hDC);
  4631.  
  4632.     [
  4633.     usesgetlasterror,
  4634.     entry("WidenPath"),
  4635.     helpstring("Redefines the current path as the area that would be painted if the path were stroked using the current pen"),
  4636.     ]
  4637.     BOOL WINAPI WidenPath(HDC hDC);
  4638.  
  4639.     // HPEN WINAPI ExtCreatePen(DWORD, DWORD, LOGBRUSH *, DWORD, const UINT *);
  4640.  
  4641.     [
  4642.     usesgetlasterror,
  4643.     entry("GetMiterLimit"),
  4644.     helpstring("Gets the limit for the length of miter joins for the specified device context"),
  4645.     ]
  4646.     BOOL WINAPI GetMiterLimit(HDC hDC, FLOAT * peOldLimit);
  4647.  
  4648.     [
  4649.     usesgetlasterror,
  4650.     entry("GetArcDirection"),
  4651.     helpstring("Gets the drawing direction used for arc and rectangle functions (AD_COUNTERCLOCKWISE or AD_CLOCKWISE)"),
  4652.     ]
  4653.     int WINAPI GetArcDirection(HDC hDC);
  4654.  
  4655.     [
  4656.     usesgetlasterror,
  4657.     #ifdef UNICODE
  4658.     entry("GetObjectW"),
  4659.     #else
  4660.     entry("GetObjectA"),
  4661.     #endif
  4662.     helpstring("Gets information about a graphics object into a buffer (BITMAP, DIBSECTION, EXTLOGPEN, LOGBRUSH, LOGFONT, LOGPEN, or count of table entries"),
  4663.     ]
  4664.     int     WINAPI VBGetObject(HGDIOBJ hgdiobj, int cbBuffer, void * lpvObject);
  4665.  
  4666.     [
  4667.     usesgetlasterror,
  4668.     #ifdef UNICODE
  4669.     entry("GetObjectW"),
  4670.     #else
  4671.     entry("GetObjectA"),
  4672.     #endif
  4673.     helpstring("Gets information about a bitmap into a BITMAP variable"),
  4674.     ]
  4675.     int     WINAPI GetObjectBitmap(HGDIOBJ hgdiobj, int cbBuffer, BITMAP * lpvObject);
  4676.  
  4677.     [
  4678.     usesgetlasterror,
  4679.     #ifdef UNICODE
  4680.     entry("GetObjectW"),
  4681.     #else
  4682.     entry("GetObjectA"),
  4683.     #endif
  4684.     helpstring("Gets information about a DIB into a DIBSECTION variable"),
  4685.     ]
  4686.     int     WINAPI GetObjectDIBSection(HGDIOBJ hgdiobj, int cbBuffer, DIBSECTION * lpvObject);
  4687.  
  4688.     [
  4689.     usesgetlasterror,
  4690.     #ifdef UNICODE
  4691.     entry("GetObjectW"),
  4692.     #else
  4693.     entry("GetObjectA"),
  4694.     #endif
  4695.     helpstring("Gets information about a logical pen into a EXTLOGPEN variable"),
  4696.     ]
  4697.     int     WINAPI GetObjectPenEx(HGDIOBJ hgdiobj, int cbBuffer, EXTLOGPEN * lpvObject);
  4698.  
  4699.     [
  4700.     usesgetlasterror,
  4701.     #ifdef UNICODE
  4702.     entry("GetObjectW"),
  4703.     #else
  4704.     entry("GetObjectA"),
  4705.     #endif
  4706.     helpstring("Gets information about a logical brush into a LOGBRUSH variable"),
  4707.     ]
  4708.     int     WINAPI GetObjectBrush(HGDIOBJ hgdiobj, int cbBuffer, LOGBRUSH * lpvObject);
  4709.  
  4710.     [
  4711.     usesgetlasterror,
  4712.     #ifdef UNICODE
  4713.     entry("GetObjectW"),
  4714.     #else
  4715.     entry("GetObjectA"),
  4716.     #endif
  4717.     helpstring("Gets information about a logical font into a LOGFONT variable"),
  4718.     ]
  4719.     int     WINAPI GetObjectFont(HGDIOBJ hgdiobj, int cbBuffer, LOGFONT * lpvObject);
  4720.  
  4721.     [
  4722.     usesgetlasterror,
  4723.     #ifdef UNICODE
  4724.     entry("GetObjectW"),
  4725.     #else
  4726.     entry("GetObjectA"),
  4727.     #endif
  4728.     helpstring("Gets information about a logical pen into a LOGPEN variable"),
  4729.     ]
  4730.     int     WINAPI GetObjectPen(HGDIOBJ hgdiobj, int cbBuffer, LOGPEN * lpvObject);
  4731.  
  4732.     [
  4733.     usesgetlasterror,
  4734.     #ifdef UNICODE
  4735.     entry("GetObjectW"),
  4736.     #else
  4737.     entry("GetObjectA"),
  4738.     #endif
  4739.     helpstring("Gets a count of palette entries for a logical palette into a variable"),
  4740.     ]
  4741.     int     WINAPI GetObjectPaletteEntries(HGDIOBJ hgdiobj, int cbBuffer, WORD * lpvObject);
  4742.  
  4743.     [
  4744.     usesgetlasterror,
  4745.     #ifdef UNICODE
  4746.     entry("GetObjectW"),
  4747.     #else
  4748.     entry("GetObjectA"),
  4749.     #endif
  4750.     helpstring("Gets information about a logical brush into a LOGFONT, LOGPEN, count of table entries (for a logical palette), into a specified buff variable"),
  4751.     ]
  4752.     int     WINAPI GetObjectLogBrush(HGDIOBJ hgdiobj, int cbBuffer, LOGBRUSH * lpvObject);
  4753.  
  4754.  
  4755.     [
  4756.     usesgetlasterror,
  4757.     entry("MoveToEx"),
  4758.     helpstring("Moves current position to (x,y) without displaying; return last position in POINTL * lpPoint"),
  4759.     ]
  4760.     BOOL    WINAPI MoveToEx(HDC hdc, int X, int Y, [defaultvalue(0)] LPVOID lpPoint);
  4761.  
  4762.     [
  4763.     usesgetlasterror,
  4764.     entry("MoveToEx"),
  4765.     helpstring("Moves current position to (x,y) without displaying (ignore compatibility null parameter)"),
  4766.     ]
  4767.     BOOL    WINAPI MoveTo(HDC hdc, int X, int Y, [defaultvalue(0)] LPVOID lpNull);
  4768.  
  4769.  
  4770.     [
  4771.     usesgetlasterror,
  4772.     #ifdef UNICODE
  4773.     entry("TextOutW"),
  4774.     #else
  4775.     entry("TextOutA"),
  4776.     #endif
  4777.     helpstring("Writes a character string at the specified location, using the currently selected font"),
  4778.     ]
  4779.     BOOL  WINAPI TextOut(HDC hdc, int nXStart, int nYStart,    
  4780.                          LPCTSTR lpString, int cbString);
  4781.       
  4782.     [
  4783.     usesgetlasterror,
  4784.     #ifdef UNICODE
  4785.     entry("ExtTextOutW"),
  4786.     #else
  4787.     entry("ExtTextOutA"),
  4788.     #endif
  4789.     helpstring("Draws a character string, optionally using a rectangle to specify clipping, opaquing, or both"),
  4790.     ]
  4791.     BOOL  WINAPI ExtTextOut(HDC hdc, int X,    int Y,    
  4792.                             UINT fuOptions,    RECT *lprc,    
  4793.                             LPCTSTR lpString, UINT cbCount,    
  4794.                             INT * lpDx);
  4795.     /*
  4796.     [
  4797.     usesgetlasterror,
  4798.     #ifdef UNICODE
  4799.     entry("PolyTextOutW"),
  4800.     #else
  4801.     entry("PolyTextOutA"),
  4802.     #endif
  4803.     helpstring("Draws several strings using the font and text colors currently selected in the specified device context"),
  4804.     ]
  4805.     BOOL  WINAPI PolyTextOut(HDC hdc, POLYTEXT * pptxt, 
  4806.                              int cStrings);
  4807.     */
  4808.  
  4809.     [
  4810.     usesgetlasterror,
  4811.     entry("CreatePolygonRgn"),
  4812.     helpstring("Creates a polygonal region"),
  4813.     ]
  4814.     HRGN  WINAPI CreatePolygonRgn(POINTL * lppt, int cPoints,    
  4815.                                   int fnPolyFillMode);
  4816.  
  4817.     [
  4818.     usesgetlasterror,
  4819.     entry("DPtoLP"),
  4820.     helpstring("Converts device coordinates into logical coordinates"),
  4821.     ]
  4822.     BOOL  WINAPI DPtoLP(HDC hdc, POINTL * lpPoint, int nCount);
  4823.  
  4824.     [
  4825.     usesgetlasterror,
  4826.     entry("LPtoDP"),
  4827.     helpstring("Converts logical coordinates into device coordinates"),
  4828.     ]
  4829.     BOOL  WINAPI LPtoDP(HDC hdc, POINTL * lpPoint, int nCount);
  4830.  
  4831.     [
  4832.     usesgetlasterror,
  4833.     entry("Polygon"),
  4834.     helpstring("Draws a polygon"),
  4835.     ]
  4836.     BOOL WINAPI Polygon(HDC hdc, POINTL * lpPoints,
  4837.                         int cPoints);
  4838.  
  4839.     [
  4840.     usesgetlasterror,
  4841.     entry("Polyline"),
  4842.     helpstring("Draws a series of line segments by connecting the points in the specified array"),
  4843.     ]
  4844.     BOOL  WINAPI Polyline(HDC hdc, POINTL * lppt, int cPoints);
  4845.  
  4846.     [
  4847.     usesgetlasterror,
  4848.     entry("PolyBezier"),
  4849.     helpstring("Draws Bezier curve controlled by array of points (cPoint specified size of array)"),
  4850.     ]
  4851.     BOOL    WINAPI PolyBezier(HDC hdc, POINTL * lppt,
  4852.                               DWORD cPoints);
  4853.  
  4854.     [
  4855.     usesgetlasterror,
  4856.     entry("PolyBezierTo"),
  4857.     helpstring("Draws Bezier curve controlled by array of points (cPoint specified size of array) and moves to last point"),
  4858.     ]
  4859.     BOOL    WINAPI PolyBezierTo(HDC hdc, POINTL * lppt,
  4860.                                 DWORD cPoints);
  4861.  
  4862.     /*
  4863.  
  4864.     [
  4865.     usesgetlasterror,
  4866.     entry("PolylineTo"),
  4867.     helpstring(""),
  4868.     ]
  4869.     BOOL  WINAPI PolylineTo(HDC hdc, POINTL * lppt, DWORD);
  4870.  
  4871.  
  4872.     [
  4873.     usesgetlasterror,
  4874.     entry("SetViewportExtEx"),
  4875.     helpstring(""),
  4876.     ]
  4877.     BOOL  WINAPI SetViewportExtEx(HDC hdc, int, int, LPSIZE);
  4878.  
  4879.     [
  4880.     usesgetlasterror,
  4881.     entry("SetViewportOrgEx"),
  4882.     helpstring(""),
  4883.     ]
  4884.     BOOL  WINAPI SetViewportOrgEx(HDC hdc, int, int, POINTL * lpPoint);
  4885.     */
  4886.  
  4887.     [
  4888.     usesgetlasterror,
  4889.     entry("SetWindowExtEx"),
  4890.     helpstring("Sets X and Y of the window for a device context using specified values"),
  4891.     ]
  4892.     BOOL    WINAPI SetWindowExtEx(HDC hdc, int nXExtent, int nYExtent, SIZE * lpSize);
  4893.  
  4894.     /*
  4895.  
  4896.     [
  4897.     usesgetlasterror,
  4898.     entry("SetWindowOrgEx"),
  4899.     helpstring(""),
  4900.     ]
  4901.     BOOL  WINAPI SetWindowOrgEx(HDC hdc, int, int, POINTL * lpPoint);
  4902.  
  4903.  
  4904.     [
  4905.     usesgetlasterror,
  4906.     entry("OffsetViewportOrgEx"),
  4907.     helpstring(""),
  4908.     ]
  4909.     BOOL  WINAPI OffsetViewportOrgEx(HDC hdc, int, int, POINTL * lpPoint);
  4910.  
  4911.     [
  4912.     usesgetlasterror,
  4913.     entry("OffsetWindowOrgEx"),
  4914.     helpstring(""),
  4915.     ]
  4916.     BOOL  WINAPI OffsetWindowOrgEx(HDC hdc, int, int, POINTL * lpPoint);
  4917.  
  4918.     [
  4919.     usesgetlasterror,
  4920.     entry("ScaleViewportExtEx"),
  4921.     helpstring(""),
  4922.     ]
  4923.     BOOL  WINAPI ScaleViewportExtEx(HDC hdc, int, int, int, int, LPSIZE);
  4924.  
  4925.     [
  4926.     usesgetlasterror,
  4927.     entry("ScaleWindowExtEx"),
  4928.     helpstring(""),
  4929.     ]
  4930.     BOOL  WINAPI ScaleWindowExtEx(HDC hdc, int, int, int, int, LPSIZE);
  4931.  
  4932.     [
  4933.     usesgetlasterror,
  4934.     entry("SetBitmapDimensionEx"),
  4935.     helpstring(""),
  4936.     ]
  4937.     BOOL  WINAPI SetBitmapDimensionEx(HBITMAP hbm, int, int, LPSIZE);
  4938.  
  4939.     [
  4940.     usesgetlasterror,
  4941.     entry("SetBrushOrgEx"),
  4942.     helpstring(""),
  4943.     ]
  4944.     BOOL  WINAPI SetBrushOrgEx(HDC hdc, int, int, POINTL * lpPoint);
  4945.  
  4946.  
  4947.     [
  4948.     usesgetlasterror,
  4949.     #ifdef UNICODE
  4950.     entry("GetTextFaceW"),
  4951.     #else
  4952.     entry("GetTextFaceA"),
  4953.     #endif
  4954.     helpstring(""),
  4955.     ]
  4956.     int   WINAPI GetTextFace(HDC hdc, int, LPTSTR);
  4957.     */
  4958.  
  4959.     const int FONTMAPPER_MAX = 10;
  4960.  
  4961.     /*
  4962.  
  4963.     [
  4964.     usesgetlasterror,
  4965.     #ifdef UNICODE
  4966.     entry("GetKerningPairsW"),
  4967.     #else
  4968.     entry("GetKerningPairsA"),
  4969.     #endif
  4970.     helpstring(""),
  4971.     ]
  4972.     DWORD WINAPI GetKerningPairs(HDC hdc, DWORD, LPKERNINGPAIR);
  4973.  
  4974.  
  4975.     [
  4976.     usesgetlasterror,
  4977.     entry("GetDCOrgEx"),
  4978.     helpstring(""),
  4979.     ]
  4980.     BOOL  WINAPI GetDCOrgEx(HDC hdc,POINTL * lpPoint);
  4981.  
  4982.     [
  4983.     usesgetlasterror,
  4984.     entry("FixBrushOrgEx"),
  4985.     helpstring(""),
  4986.     ]
  4987.     BOOL  WINAPI FixBrushOrgEx(HDC hdc,int,int,POINTL * lpPoint);
  4988.     */
  4989.  
  4990.     [
  4991.     usesgetlasterror,
  4992.     entry("UnrealizeObject"),
  4993.     helpstring("Resets a logical palette, directing the system to realize the palette as though it had not previously been realized"),
  4994.     ]
  4995.     BOOL    WINAPI UnrealizeObject(HGDIOBJ hgdiobj);
  4996.  
  4997.     /*
  4998.     BOOL  WINAPI GdiFlush();
  4999.     DWORD WINAPI GdiSetBatchLimit(DWORD);
  5000.     DWORD WINAPI GdiGetBatchLimit();
  5001.     */
  5002.  
  5003.     const int ICM_OFF   = 1;
  5004.     const int ICM_ON    = 2;
  5005.     const int ICM_QUERY = 3;
  5006.  
  5007.     /*
  5008.  
  5009.     [
  5010.     usesgetlasterror,
  5011.     entry("SetICMMode"),
  5012.     helpstring(""),
  5013.     ]
  5014.     int WINAPI SetICMMode(HDC hdc, int);
  5015.  
  5016.     [
  5017.     usesgetlasterror,
  5018.     entry("CheckColorsInGamut"),
  5019.     helpstring(""),
  5020.     ]
  5021.     BOOL WINAPI CheckColorsInGamut(HDC hdc,LPVOID,LPVOID,DWORD);
  5022.  
  5023.     [
  5024.     usesgetlasterror,
  5025.     entry("GetColorSpace"),
  5026.     helpstring(""),
  5027.     ]
  5028.     HANDLE WINAPI GetColorSpace(HDC hdc);
  5029.  
  5030.     [
  5031.     usesgetlasterror,
  5032.     #ifdef UNICODE
  5033.     entry("GetLogColorSpaceW"),
  5034.     #else
  5035.     entry("GetLogColorSpaceA"),
  5036.     #endif
  5037.     helpstring(""),
  5038.     ]
  5039.     BOOL WINAPI GetLogColorSpace(HCOLORSPACE,LPLOGCOLORSPACEA,DWORD);
  5040.  
  5041.     [
  5042.     usesgetlasterror,
  5043.     #ifdef UNICODE
  5044.     entry("CreateColorSpaceW"),
  5045.     #else
  5046.     entry("CreateColorSpaceA"),
  5047.     #endif
  5048.     helpstring(""),
  5049.     ]
  5050.     HCOLORSPACE WINAPI CreateColorSpace(LPLOGCOLORSPACEA);
  5051.  
  5052.     [
  5053.     usesgetlasterror,
  5054.     entry("SetColorSpace"),
  5055.     helpstring(""),
  5056.     ]
  5057.     BOOL WINAPI SetColorSpace(HDC hdc,HCOLORSPACE);
  5058.  
  5059.     [
  5060.     usesgetlasterror,
  5061.     entry("DeleteColorSpace"),
  5062.     helpstring(""),
  5063.     ]
  5064.     BOOL WINAPI DeleteColorSpace(HCOLORSPACE);
  5065.  
  5066.     [
  5067.     usesgetlasterror,
  5068.     #ifdef UNICODE
  5069.     entry("GetICMProfileW"),
  5070.     #else
  5071.     entry("GetICMProfileA"),
  5072.     #endif
  5073.     helpstring(""),
  5074.     ]
  5075.     BOOL WINAPI GetICMProfile(HDC hdc,LPDWORD,LPTSTR);
  5076.  
  5077.     [
  5078.     usesgetlasterror,
  5079.     #ifdef UNICODE
  5080.     entry("SetICMProfileW"),
  5081.     #else
  5082.     entry("SetICMProfileA"),
  5083.     #endif
  5084.     helpstring(""),
  5085.     ]
  5086.     BOOL WINAPI SetICMProfile(HDC hdc,LPTSTR);
  5087.  
  5088.     [
  5089.     usesgetlasterror,
  5090.     entry("GetDeviceGammaRamp"),
  5091.     helpstring(""),
  5092.     ]
  5093.     BOOL WINAPI GetDeviceGammaRamp(HDC hdc,LPVOID);
  5094.  
  5095.     [
  5096.     usesgetlasterror,
  5097.     entry("SetDeviceGammaRamp"),
  5098.     helpstring(""),
  5099.     ]
  5100.     BOOL WINAPI SetDeviceGammaRamp(HDC hdc,LPVOID);
  5101.  
  5102.     [
  5103.     usesgetlasterror,
  5104.     entry("ColorMatchToTarget"),
  5105.     helpstring(""),
  5106.     ]
  5107.     BOOL WINAPI ColorMatchToTarget(HDC hdc,HDC hdc,DWORD);
  5108.  
  5109.     [
  5110.     usesgetlasterror,
  5111.     #ifdef UNICODE
  5112.     entry("UpdateICMRegKeyW"),
  5113.     #else
  5114.     entry("UpdateICMRegKeyA"),
  5115.     #endif
  5116.     helpstring(""),
  5117.     ]
  5118.     BOOL WINAPI UpdateICMRegKey(DWORD, DWORD, LPTSTR, UINT);
  5119.     */
  5120.  
  5121.     [
  5122.     usesgetlasterror,
  5123.     #ifdef UNICODE
  5124.     entry("EnumICMProfilesW"),
  5125.     #else
  5126.     entry("EnumICMProfilesA"),
  5127.     #endif
  5128.     helpstring("Enumerates the different color profiles that the system supports for the specified device context"),
  5129.     ]
  5130.     int WINAPI EnumICMProfiles(HDC hdc,
  5131.                                ICMENUMPROC lpICMProfilesFunc,
  5132.                                LPARAM lParam);
  5133.  
  5134.  
  5135.  
  5136.     // Enhanced metafile constants.
  5137.  
  5138.     const UINT ENHMETA_SIGNATURE       = 0x464D4520;
  5139.  
  5140.     // Stock object flag used in the object handle index in the enhanced
  5141.     // metafile records.
  5142.     // E.g. The object handle index (META_STOCK_OBJECT | BLACK_BRUSH)
  5143.     // represents the stock object BLACK_BRUSH.
  5144.  
  5145.     const UINT ENHMETA_STOCK_OBJECT    = 0x80000000;
  5146.  
  5147.     // Enhanced metafile record types.
  5148.  
  5149.     const int EMR_HEADER                      = 1;
  5150.     const int EMR_POLYBEZIER                  = 2;
  5151.     const int EMR_POLYGON                     = 3;
  5152.     const int EMR_POLYLINE                    = 4;
  5153.     const int EMR_POLYBEZIERTO                = 5;
  5154.     const int EMR_POLYLINETO                  = 6;
  5155.     const int EMR_POLYPOLYLINE                = 7;
  5156.     const int EMR_POLYPOLYGON                 = 8;
  5157.     const int EMR_SETWINDOWEXTEX              = 9;
  5158.     const int EMR_SETWINDOWORGEX              = 10;
  5159.     const int EMR_SETVIEWPORTEXTEX            = 11;
  5160.     const int EMR_SETVIEWPORTORGEX            = 12;
  5161.     const int EMR_SETBRUSHORGEX               = 13;
  5162.     const int EMR_EOF                         = 14;
  5163.     const int EMR_SETPIXELV                   = 15;
  5164.     const int EMR_SETMAPPERFLAGS              = 16;
  5165.     const int EMR_SETMAPMODE                  = 17;
  5166.     const int EMR_SETBKMODE                   = 18;
  5167.     const int EMR_SETPOLYFILLMODE             = 19;
  5168.     const int EMR_SETROP2                     = 20;
  5169.     const int EMR_SETSTRETCHBLTMODE           = 21;
  5170.     const int EMR_SETTEXTALIGN                = 22;
  5171.     const int EMR_SETCOLORADJUSTMENT          = 23;
  5172.     const int EMR_SETTEXTCOLOR                = 24;
  5173.     const int EMR_SETBKCOLOR                  = 25;
  5174.     const int EMR_OFFSETCLIPRGN               = 26;
  5175.     const int EMR_MOVETOEX                    = 27;
  5176.     const int EMR_SETMETARGN                  = 28;
  5177.     const int EMR_EXCLUDECLIPRECT             = 29;
  5178.     const int EMR_INTERSECTCLIPRECT           = 30;
  5179.     const int EMR_SCALEVIEWPORTEXTEX          = 31;
  5180.     const int EMR_SCALEWINDOWEXTEX            = 32;
  5181.     const int EMR_SAVEDC                      = 33;
  5182.     const int EMR_RESTOREDC                   = 34;
  5183.     const int EMR_SETWORLDTRANSFORM           = 35;
  5184.     const int EMR_MODIFYWORLDTRANSFORM        = 36;
  5185.     const int EMR_SELECTOBJECT                = 37;
  5186.     const int EMR_CREATEPEN                   = 38;
  5187.     const int EMR_CREATEBRUSHINDIRECT         = 39;
  5188.     const int EMR_DELETEOBJECT                = 40;
  5189.     const int EMR_ANGLEARC                    = 41;
  5190.     const int EMR_ELLIPSE                     = 42;
  5191.     const int EMR_RECTANGLE                   = 43;
  5192.     const int EMR_ROUNDRECT                   = 44;
  5193.     const int EMR_ARC                         = 45;
  5194.     const int EMR_CHORD                       = 46;
  5195.     const int EMR_PIE                         = 47;
  5196.     const int EMR_SELECTPALETTE               = 48;
  5197.     const int EMR_CREATEPALETTE               = 49;
  5198.     const int EMR_SETPALETTEENTRIES           = 50;
  5199.     const int EMR_RESIZEPALETTE               = 51;
  5200.     const int EMR_REALIZEPALETTE              = 52;
  5201.     const int EMR_EXTFLOODFILL                = 53;
  5202.     const int EMR_LINETO                      = 54;
  5203.     const int EMR_ARCTO                       = 55;
  5204.     const int EMR_POLYDRAW                    = 56;
  5205.     const int EMR_SETARCDIRECTION             = 57;
  5206.     const int EMR_SETMITERLIMIT               = 58;
  5207.     const int EMR_BEGINPATH                   = 59;
  5208.     const int EMR_ENDPATH                     = 60;
  5209.     const int EMR_CLOSEFIGURE                 = 61;
  5210.     const int EMR_FILLPATH                    = 62;
  5211.     const int EMR_STROKEANDFILLPATH           = 63;
  5212.     const int EMR_STROKEPATH                  = 64;
  5213.     const int EMR_FLATTENPATH                 = 65;
  5214.     const int EMR_WIDENPATH                   = 66;
  5215.     const int EMR_SELECTCLIPPATH              = 67;
  5216.     const int EMR_ABORTPATH                   = 68;
  5217.  
  5218.     const int EMR_GDICOMMENT                  = 70;
  5219.     const int EMR_FILLRGN                     = 71;
  5220.     const int EMR_FRAMERGN                    = 72;
  5221.     const int EMR_INVERTRGN                   = 73;
  5222.     const int EMR_PAINTRGN                    = 74;
  5223.     const int EMR_EXTSELECTCLIPRGN            = 75;
  5224.     const int EMR_BITBLT                      = 76;
  5225.     const int EMR_STRETCHBLT                  = 77;
  5226.     const int EMR_MASKBLT                     = 78;
  5227.     const int EMR_PLGBLT                      = 79;
  5228.     const int EMR_SETDIBITSTODEVICE           = 80;
  5229.     const int EMR_STRETCHDIBITS               = 81;
  5230.     const int EMR_EXTCREATEFONTINDIRECTW      = 82;
  5231.     const int EMR_EXTTEXTOUTA                 = 83;
  5232.     const int EMR_EXTTEXTOUTW                 = 84;
  5233.     const int EMR_POLYBEZIER16                = 85;
  5234.     const int EMR_POLYGON16                   = 86;
  5235.     const int EMR_POLYLINE16                  = 87;
  5236.     const int EMR_POLYBEZIERTO16              = 88;
  5237.     const int EMR_POLYLINETO16                = 89;
  5238.     const int EMR_POLYPOLYLINE16              = 90;
  5239.     const int EMR_POLYPOLYGON16               = 91;
  5240.     const int EMR_POLYDRAW16                  = 92;
  5241.     const int EMR_CREATEMONOBRUSH             = 93;
  5242.     const int EMR_CREATEDIBPATTERNBRUSHPT     = 94;
  5243.     const int EMR_EXTCREATEPEN                = 95;
  5244.     const int EMR_POLYTEXTOUTA                = 96;
  5245.     const int EMR_POLYTEXTOUTW                = 97;
  5246.     const int EMR_SETICMMODE                  = 98;
  5247.     const int EMR_CREATECOLORSPACE            = 99;
  5248.     const int EMR_SETCOLORSPACE               = 100;
  5249.     const int EMR_DELETECOLORSPACE            = 101;
  5250.  
  5251.     const int EMR_MIN                         = 1;
  5252.  
  5253.     #if (WINVER >= 0x0400)
  5254.     const int EMR_MAX                         = 101;
  5255.     #else
  5256.     const int EMR_MAX                         = 97;
  5257.     #endif
  5258.  
  5259.  
  5260.     const UINT GDICOMMENT_IDENTIFIER           = 0x43494447;
  5261.     const UINT GDICOMMENT_WINDOWS_METAFILE     = 0x80000001;
  5262.     const UINT GDICOMMENT_BEGINGROUP           = 0x00000002;
  5263.     const UINT GDICOMMENT_ENDGROUP             = 0x00000003;
  5264.     const UINT GDICOMMENT_MULTIFORMATS         = 0x40000004;
  5265.     const UINT EPS_SIGNATURE                   = 0x46535045;
  5266.  
  5267.     // OpenGL wgl prototypes
  5268.  
  5269.     /*
  5270.  
  5271.     [
  5272.     usesgetlasterror,
  5273.     entry("wglCreateContext"),
  5274.     helpstring(""),
  5275.     ]
  5276.     HGLRC WINAPI wglCreateContext(HDC hdc);
  5277.  
  5278.     [
  5279.     usesgetlasterror,
  5280.     entry("wglDeleteContext"),
  5281.     helpstring(""),
  5282.     ]
  5283.     BOOL  WINAPI wglDeleteContext(HGLRC);
  5284.  
  5285.     [
  5286.     usesgetlasterror,
  5287.     entry("wglGetCurrentContext"),
  5288.     helpstring(""),
  5289.     ]
  5290.     HGLRC WINAPI wglGetCurrentContext(VOID);
  5291.  
  5292.     [
  5293.     usesgetlasterror,
  5294.     entry("wglGetCurrentDC"),
  5295.     helpstring(""),
  5296.     ]
  5297.     HDC WINAPI wglGetCurrentDC(VOID);
  5298.  
  5299.     [
  5300.     usesgetlasterror,
  5301.     entry("wglGetProcAddress"),
  5302.     helpstring(""),
  5303.     ]
  5304.     PROC  WINAPI wglGetProcAddress(LPCTSTR);
  5305.  
  5306.     [
  5307.     usesgetlasterror,
  5308.     entry("wglMakeCurrent"),
  5309.     helpstring(""),
  5310.     ]
  5311.     BOOL  WINAPI wglMakeCurrent(HDC hdc, HGLRC);
  5312.  
  5313.     [
  5314.     usesgetlasterror,
  5315.     entry("wglShareLists"),
  5316.     helpstring(""),
  5317.     ]
  5318.     BOOL  WINAPI wglShareLists(HGLRC, HGLRC);
  5319.  
  5320.     [
  5321.     usesgetlasterror,
  5322.     #ifdef UNICODE
  5323.     entry("wglUseFontBitmapsW"),
  5324.     #else
  5325.     entry("wglUseFontBitmapsA"),
  5326.     #endif
  5327.     helpstring(""),
  5328.     ]
  5329.     BOOL  WINAPI wglUseFontBitmaps(HDC hdc, DWORD, DWORD, DWORD);
  5330.  
  5331.     [
  5332.     usesgetlasterror,
  5333.     entry("SwapBuffers"),
  5334.     helpstring(""),
  5335.     ]
  5336.     BOOL  WINAPI SwapBuffers(HDC hdc);
  5337.     */
  5338.  
  5339.     const int WGL_FONT_LINES      = 0;
  5340.     const int WGL_FONT_POLYGONS   = 1;
  5341.  
  5342.     /*
  5343.  
  5344.     [
  5345.     usesgetlasterror,
  5346.     #ifdef UNICODE
  5347.     entry("wglUseFontOutlinesW"),
  5348.     #else
  5349.     entry("wglUseFontOutlinesA"),
  5350.     #endif
  5351.     helpstring(""),
  5352.     ]
  5353.     BOOL  WINAPI wglUseFontOutlines(HDC hdc, DWORD, DWORD, DWORD, FLOAT,
  5354.     */
  5355. }
  5356.  
  5357. #endif // _WINGDI_ 
  5358.